mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jianjun Wang (王建军)" <Jianjun.Wang@mediatek.com>
To: "caihuoqing@baidu.com" <caihuoqing@baidu.com>
Cc: "linux-mediatek@lists.infradead.org"
	<linux-mediatek@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"kw@linux.com" <kw@linux.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"Ryder Lee (李庚諺)" <Ryder.Lee@mediatek.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: mediatek-gen3: Make use of the helper function devm_platform_ioremap_resource_byname()
Date: Wed, 1 Sep 2021 11:46:47 +0000	[thread overview]
Message-ID: <d1ad95b4b4a7ac4f729bd9338b0448d9d32cfc29.camel@mediatek.com> (raw)
In-Reply-To: <20210901074006.8783-1-caihuoqing@baidu.com>

On Wed, 2021-09-01 at 15:40 +0800, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/pci/controller/pcie-mediatek-gen3.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/pcie-mediatek-gen3.c
> b/drivers/pci/controller/pcie-mediatek-gen3.c
> index 17c59b0d6978..014747c6dcd4 100644
> --- a/drivers/pci/controller/pcie-mediatek-gen3.c
> +++ b/drivers/pci/controller/pcie-mediatek-gen3.c
> @@ -715,10 +715,7 @@ static int mtk_pcie_parse_port(struct
> mtk_pcie_port *port)
>  	struct resource *regs;
>  	int ret;
>  
> -	regs = platform_get_resource_byname(pdev, IORESOURCE_MEM,
> "pcie-mac");
> -	if (!regs)
> -		return -EINVAL;
> -	port->base = devm_ioremap_resource(dev, regs);
> +	port->base = devm_platform_ioremap_resource_byname(pdev, "pcie-
> mac");
>  	if (IS_ERR(port->base)) {
>  		dev_err(dev, "failed to map register base\n");
>  		return PTR_ERR(port->base);

This "regs" will be used by port->reg_base as follows:

	port->reg_base = regs->start;

Please don't remove it directly.

Thanks.

      reply	other threads:[~2021-09-01 13:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  7:40 Cai Huoqing
2021-09-01 11:46 ` Jianjun Wang (王建军) [this message]

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=d1ad95b4b4a7ac4f729bd9338b0448d9d32cfc29.camel@mediatek.com \
    --to=jianjun.wang@mediatek.com \
    --cc=Ryder.Lee@mediatek.com \
    --cc=bhelgaas@google.com \
    --cc=caihuoqing@baidu.com \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    /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

all inboxes | Powered by JetHome®