Skip to contentSkip to conversation

mips/pci: use devm_platform_ioremap_resource()

PATCH Superseded [email protected] 2 participants 2 messages Nov 30, 2022 – Dec 1, 2022 MIPS

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips/pci: use devm_platform_ioremap_resource()

From: zhang songyi <[email protected]>

Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately

---
 arch/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/mips/pci/pci-rt3883.c +1 -3
index e07ae098bdd8..d59888aaed81 100644
@@ -404,7 +404,6 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        struct rt3883_pci_controller *rpc;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
-       struct resource *res;
        struct device_node *child;
        u32 val;
        int err;
@@ -414,8 +413,7 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        if (!rpc)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rpc->base = devm_ioremap_resource(dev, res);
+       rpc->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rpc->base))
                return PTR_ERR(rpc->base);
 

--
2.15.2

#1 lore raw
Quoted 34 lines · On Wed, Nov 30, 2022 at 03:51:25PM +0800, [email protected] wrote:

From: zhang songyi <[email protected]>

Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately

---
 arch/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/mips/pci/pci-rt3883.c +1 -4
index e07ae098bdd8..d59888aaed81 100644
@@ -404,7 +404,6 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        struct rt3883_pci_controller *rpc;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
-       struct resource *res;
        struct device_node *child;
        u32 val;
        int err;
@@ -414,8 +413,7 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        if (!rpc)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rpc->base = devm_ioremap_resource(dev, res);
+       rpc->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rpc->base))
                return PTR_ERR(rpc->base);
 
--
Quoted 1 line

2.15.2

this patch doesn't apply because it's white-space damaged.

Thomas.

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