Skip to contentSkip to conversation

MIPS: pci-mt7620: Use devm_platform_get_and_ioremap_resource()

PATCH Applied [email protected] 2 participants 2 messages Feb 8, 2023 – Feb 9, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: pci-mt7620: Use devm_platform_get_and_ioremap_resource()

From: Ye Xingchen <[email protected]>

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.

---
 arch/mips/pci/pci-mt7620.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
arch/mips/pci/pci-mt7620.c +2 -6
index e032932348d6..2700d75d41c5 100644
@@ -282,21 +282,17 @@ static int mt7628_pci_hw_init(struct platform_device *pdev)
 
 static int mt7620_pci_probe(struct platform_device *pdev)
 {
-	struct resource *bridge_res = platform_get_resource(pdev,
-							    IORESOURCE_MEM, 0);
-	struct resource *pcie_res = platform_get_resource(pdev,
-							  IORESOURCE_MEM, 1);
 	u32 val = 0;
 
 	rstpcie0 = devm_reset_control_get_exclusive(&pdev->dev, "pcie0");
 	if (IS_ERR(rstpcie0))
 		return PTR_ERR(rstpcie0);
 
-	bridge_base = devm_ioremap_resource(&pdev->dev, bridge_res);
+	bridge_base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
 	if (IS_ERR(bridge_base))
 		return PTR_ERR(bridge_base);
 
-	pcie_base = devm_ioremap_resource(&pdev->dev, pcie_res);
+	pcie_base = devm_platform_get_and_ioremap_resource(pdev, 1, NULL);
 	if (IS_ERR(pcie_base))
 		return PTR_ERR(pcie_base);
 
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 10 lines · On Wed, Feb 08, 2023 at 10:48:03AM +0800, [email protected] wrote:

From: Ye Xingchen <[email protected]>

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.

---
 arch/mips/pci/pci-mt7620.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]