Skip to content

Commit 663bf6a

Browse files
Ye Xingchentsbogend
authored andcommitted
MIPS: pci-mt7620: Use devm_platform_get_and_ioremap_resource()
Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent 7c035a1 commit 663bf6a

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

arch/mips/pci/pci-mt7620.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -282,21 +282,17 @@ static int mt7628_pci_hw_init(struct platform_device *pdev)
282282

283283
static int mt7620_pci_probe(struct platform_device *pdev)
284284
{
285-
struct resource *bridge_res = platform_get_resource(pdev,
286-
IORESOURCE_MEM, 0);
287-
struct resource *pcie_res = platform_get_resource(pdev,
288-
IORESOURCE_MEM, 1);
289285
u32 val = 0;
290286

291287
rstpcie0 = devm_reset_control_get_exclusive(&pdev->dev, "pcie0");
292288
if (IS_ERR(rstpcie0))
293289
return PTR_ERR(rstpcie0);
294290

295-
bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res);
291+
bridge_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
296292
if (IS_ERR(bridge_base))
297293
return PTR_ERR(bridge_base);
298294

299-
pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res);
295+
pcie_base = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
300296
if (IS_ERR(pcie_base))
301297
return PTR_ERR(pcie_base);
302298

0 commit comments

Comments
 (0)