@@ -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)) {
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.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)