[PATCH] PCI: mediatek: Make use of the helper function devm_platform_ioremap_resource_byname()
Cai Huoqing
caihuoqing at baidu.com
Wed Sep 1 00:39:41 PDT 2021
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 at baidu.com>
---
drivers/pci/controller/pcie-mediatek.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
index 4cb5ea8e1069..90913025da05 100644
--- a/drivers/pci/controller/pcie-mediatek.c
+++ b/drivers/pci/controller/pcie-mediatek.c
@@ -980,16 +980,12 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie)
{
struct device *dev = pcie->dev;
struct platform_device *pdev = to_platform_device(dev);
- struct resource *regs;
int err;
/* get shared registers, which are optional */
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "subsys");
- if (regs) {
- pcie->base = devm_ioremap_resource(dev, regs);
- if (IS_ERR(pcie->base))
- return PTR_ERR(pcie->base);
- }
+ pcie->base = devm_platform_ioremap_resource_byname(pdev, "subsys");
+ if (IS_ERR(pcie->base))
+ return PTR_ERR(pcie->base);
pcie->free_ck = devm_clk_get(dev, "free_ck");
if (IS_ERR(pcie->free_ck)) {
--
2.25.1
More information about the linux-arm-kernel
mailing list