[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210902063702.32066-4-caihuoqing@baidu.com>
Date: Thu, 2 Sep 2021 14:37:02 +0800
From: Cai Huoqing <caihuoqing@...du.com>
To: <gregkh@...uxfoundation.org>, <rafael@...nel.org>,
<patrice.chotard@...s.st.com>, <mchehab@...nel.org>,
<ryder.lee@...iatek.com>, <jianjun.wang@...iatek.com>,
<lorenzo.pieralisi@....com>, <robh@...nel.org>, <kw@...ux.com>,
<bhelgaas@...gle.com>, <matthias.bgg@...il.com>
CC: <linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-media@...r.kernel.org>, <linux-pci@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>,
Cai Huoqing <caihuoqing@...du.com>
Subject: [PATCH v2 3/3] PCI: mediatek-gen3: Make use of the helper function devm_platform_get_and_ioremap_resource_byname()
Use the devm_platform_get_and_ioremap_resource_byname() helper
instead of calling platform_get_resource_byname() and
devm_ioremap_resource() separately.
Signed-off-by: Cai Huoqing <caihuoqing@...du.com>
---
v1->v2: Use devm_platform_get_and_ioremap_resource_byname()
instead of devm_platform_ioremap_resource_byname().
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..27009da62ec1 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_get_and_ioremap_resource_byname(pdev, "pcie-mac", ®s);
if (IS_ERR(port->base)) {
dev_err(dev, "failed to map register base\n");
return PTR_ERR(port->base);
--
2.25.1
Powered by blists - more mailing lists