[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d1ad95b4b4a7ac4f729bd9338b0448d9d32cfc29.camel@mediatek.com>
Date: Wed, 1 Sep 2021 11:46:47 +0000
From: Jianjun Wang (王建军)
<Jianjun.Wang@...iatek.com>
To: "caihuoqing@...du.com" <caihuoqing@...du.com>
CC: "linux-mediatek@...ts.infradead.org"
<linux-mediatek@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
"robh@...nel.org" <robh@...nel.org>, "kw@...ux.com" <kw@...ux.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
Ryder Lee (李庚諺) <Ryder.Lee@...iatek.com>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>
Subject: Re: [PATCH] PCI: mediatek-gen3: Make use of the helper function
devm_platform_ioremap_resource_byname()
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@...du.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.
Powered by blists - more mailing lists