linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Yanchao Yang (杨彦超)" <Yanchao.Yang@mediatek.com>
Cc: "Chris Feng (冯保林)" <Chris.Feng@mediatek.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"Mingliang Xu (徐明亮)" <mingliang.xu@mediatek.com>,
	"Min Dong (董敏)" <min.dong@mediatek.com>,
	"linuxwwan@intel.com" <linuxwwan@intel.com>,
	"m.chetan.kumar@intel.com" <m.chetan.kumar@intel.com>,
	"Liang Lu (吕亮)" <liang.lu@mediatek.com>,
	"Haijun Liu (刘海军)" <haijun.liu@mediatek.com>,
	"Haozhe Chang (常浩哲)" <Haozhe.Chang@mediatek.com>,
	"Hua Yang (杨华)" <Hua.Yang@mediatek.com>,
	"ryazanov.s.a@gmail.com" <ryazanov.s.a@gmail.com>,
	"Xiayu Zhang (张夏宇)" <Xiayu.Zhang@mediatek.com>,
	"loic.poulain@linaro.org" <loic.poulain@linaro.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"Ting Wang (王挺)" <ting.wang@mediatek.com>,
	"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Aiden Wang ( 王咏麒)" <Aiden.Wang@mediatek.com>,
	"Felix Chen ( 陈非)" <Felix.Chen@mediatek.com>,
	"Lambert Wang ( 王伟)" <Lambert.Wang@mediatek.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"Mingchuang Qiao (乔明闯)" <Mingchuang.Qiao@mediatek.com>,
	"Guohao Zhang (张国豪)" <Guohao.Zhang@mediatek.com>
Subject: Re: [PATCH net-next v3 01/10] net: wwan: tmi: Add PCIe core
Date: Thu, 16 Feb 2023 10:10:34 -0800	[thread overview]
Message-ID: <20230216101034.3f742834@kernel.org> (raw)
In-Reply-To: <2e518c17bf54298a2108de75fcd35aaf2b3397d3.camel@mediatek.com>

On Thu, 16 Feb 2023 12:50:44 +0000 Yanchao Yang (杨彦超) wrote:
> > > +	pci_clear_master(pdev);
> > > +	mtk_mhccif_exit(mdev);
> > > +	mtk_pci_free_irq(mdev);
> > > +	mtk_pci_bar_exit(mdev);
> > > +	pci_disable_device(pdev);
> > > +	pci_load_and_free_saved_state(pdev, &priv->saved_state);
> > > +	devm_kfree(dev, priv);
> > > +	devm_kfree(dev, mdev);  
> > 
> > Why are you using devm_ if you call kfree explicitly anyway?
> > You can save some memory by using kfree() directly.  
> devm_kzalloc(), devm_ioremap_resource(), devm_request_irq(),
> devm_gpio_request(), devm_clk_get()…..
> They will be freed automatically
> when corresponding device is freed, so you don’t have to free them
> explicitly. This also make probe error easier to handle. Is it ok?

Yes.

  reply	other threads:[~2023-02-16 18:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  8:37 [PATCH net-next v3 00/10] net: wwan: tmi: PCIe driver for MediaTek M.2 modem Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 01/10] net: wwan: tmi: Add PCIe core Yanchao Yang
2023-02-15  4:22   ` Jakub Kicinski
2023-02-16 12:50     ` Yanchao Yang (杨彦超)
2023-02-16 18:10       ` Jakub Kicinski [this message]
2023-02-24  7:39       ` Yanchao Yang (杨彦超)
2023-02-24 19:50         ` Jakub Kicinski
2023-02-27 12:11           ` Yanchao Yang (杨彦超)
2023-02-27 19:00             ` Jakub Kicinski
2023-02-28  7:47               ` Yanchao Yang (杨彦超)
     [not found]                 ` <20230228103132.325def4c@kernel.org>
2023-03-01  3:35                   ` Yanchao Yang (杨彦超)
2023-03-01  4:05                     ` Jakub Kicinski
2023-03-02  9:08                       ` Yanchao Yang (杨彦超)
2023-03-17  8:50                       ` Yanchao Yang (杨彦超)
2023-02-11  8:37 ` [PATCH net-next v3 02/10] net: wwan: tmi: Add control plane transaction layer Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 03/10] net: wwan: tmi: Add control DMA interface Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 04/10] net: wwan: tmi: Add control port Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 05/10] net: wwan: tmi: Add FSM thread Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 06/10] net: wwan: tmi: Add AT & MBIM WWAN ports Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 07/10] net: wwan: tmi: Introduce data plane hardware interface Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 08/10] net: wwan: tmi: Add data plane transaction layer Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 09/10] net: wwan: tmi: Introduce WWAN interface Yanchao Yang
2023-02-11  8:37 ` [PATCH net-next v3 10/10] net: wwan: tmi: Add maintainers and documentation Yanchao Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230216101034.3f742834@kernel.org \
    --to=kuba@kernel.org \
    --cc=Aiden.Wang@mediatek.com \
    --cc=Chris.Feng@mediatek.com \
    --cc=Felix.Chen@mediatek.com \
    --cc=Guohao.Zhang@mediatek.com \
    --cc=Haozhe.Chang@mediatek.com \
    --cc=Hua.Yang@mediatek.com \
    --cc=Lambert.Wang@mediatek.com \
    --cc=Mingchuang.Qiao@mediatek.com \
    --cc=Xiayu.Zhang@mediatek.com \
    --cc=Yanchao.Yang@mediatek.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=haijun.liu@mediatek.com \
    --cc=johannes@sipsolutions.net \
    --cc=liang.lu@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linuxwwan@intel.com \
    --cc=loic.poulain@linaro.org \
    --cc=m.chetan.kumar@intel.com \
    --cc=min.dong@mediatek.com \
    --cc=mingliang.xu@mediatek.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=ting.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).