Skip to contentSkip to conversation

media: atmel: atmel-isc: Use devm_platform_ioremap_resource()

PATCH In review Yang Li 2 participants 2 messages Mar 15, 2023 – Mar 16, 2023

Subsystems (3)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH v2 1/1 media: atmel: atmel-isc: Use devm_platform_ioremap_resource()

According to commit 7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to use devm_platform_ioremap_resource(), as this is exactly what this function does.

---

change in v2:
According to Claudiu's suggestion, make the 'Use' to 'use'in the commit description.

 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 4 +---
 drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c +1 -3
index ba0614f981a2..eebb336efce7 100644
@@ -389,7 +389,6 @@ static int atmel_isc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct isc_device *isc;
-	struct resource *res;
 	void __iomem *io_base;
 	struct isc_subdev_entity *subdev_entity;
 	int irq;
@@ -403,8 +402,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, isc);
 	isc->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	io_base = devm_ioremap_resource(dev, res);
+	io_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(io_base))
 		return PTR_ERR(io_base);
 
drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c +1 -3
index 01ababdfcbd9..beed40fe3f91 100644
@@ -378,7 +378,6 @@ static int microchip_xisc_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct isc_device *isc;
-	struct resource *res;
 	void __iomem *io_base;
 	struct isc_subdev_entity *subdev_entity;
 	int irq;
@@ -392,8 +391,7 @@ static int microchip_xisc_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, isc);
 	isc->dev = dev;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	io_base = devm_ioremap_resource(dev, res);
+	io_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(io_base))
 		return PTR_ERR(io_base);
 
Signature · 1 line
2.20.1.7.g153144c
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · Yang Li

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

According to commit 7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()"), convert platform_get_resource(), devm_ioremap_resource() to a single call to use devm_platform_ioremap_resource(), as this is exactly what this function does.

Quoted 56 lines

---

change in v2:
According to Claudiu's suggestion, make the 'Use' to 'use'in the commit description.

 drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c | 4 +---
 drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/staging/media/deprecated/atmel/atmel-sama5d2-isc.c +1 -3
index ba0614f981a2..eebb336efce7 100644
@@ -389,7 +389,6 @@ static int atmel_isc_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct isc_device *isc;
-       struct resource *res;
        void __iomem *io_base;
        struct isc_subdev_entity *subdev_entity;
        int irq;
@@ -403,8 +402,7 @@ static int atmel_isc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, isc);
        isc->dev = dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       io_base = devm_ioremap_resource(dev, res);
+       io_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(io_base))
                return PTR_ERR(io_base);
 
drivers/staging/media/deprecated/atmel/atmel-sama7g5-isc.c +1 -4
index 01ababdfcbd9..beed40fe3f91 100644
@@ -378,7 +378,6 @@ static int microchip_xisc_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct isc_device *isc;
-       struct resource *res;
        void __iomem *io_base;
        struct isc_subdev_entity *subdev_entity;
        int irq;
@@ -392,8 +391,7 @@ static int microchip_xisc_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, isc);
        isc->dev = dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       io_base = devm_ioremap_resource(dev, res);
+       io_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(io_base))
                return PTR_ERR(io_base);
 
--

2.20.1.7.g153144c