Skip to contentSkip to conversation

iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource

PATCH In review Aishwarya R 2 participants 4 messages Apr 9, 2020 – Apr 13, 2020

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

PATCH 1/1 iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource

Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

---
 drivers/iio/adc/fsl-imx25-gcq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/fsl-imx25-gcq.c +1 -3
index fa71489195c6..b0a4dc88ba9b 100644
@@ -294,7 +294,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 	struct mx25_gcq_priv *priv;
 	struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *mem;
 	int ret;
 	int i;
@@ -305,8 +304,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 
 	priv = iio_priv(indio_dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mem = devm_ioremap_resource(dev, res);
+	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
 		return PTR_ERR(mem);
 
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 5 lines · On Thu, 9 Apr 2020 20:43:05 +0530 Aishwarya R <[email protected]> wrote:

Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.

Please update the commit message for v2. In particular if an automated tool was used to identify this location then mention that. If not just say 'by inspection' or similar!

Also, same thing about the signed-off-by as in previous patch.

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/iio/adc/fsl-imx25-gcq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/fsl-imx25-gcq.c +1 -3
index fa71489195c6..b0a4dc88ba9b 100644
@@ -294,7 +294,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 	struct mx25_gcq_priv *priv;
 	struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *mem;
 	int ret;
 	int i;
@@ -305,8 +304,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 
 	priv = iio_priv(indio_dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mem = devm_ioremap_resource(dev, res);
+	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
 		return PTR_ERR(mem);
 
#2 lore raw

PATCH 1/1 iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource

In reply to Aishwarya R

From: Aishwarya Ramakrishnan <[email protected]>

Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.It reduces boilerplate and suggested by coccinelle.

---
 drivers/iio/adc/fsl-imx25-gcq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/fsl-imx25-gcq.c +1 -3
index fa71489195c6..b0a4dc88ba9b 100644
@@ -294,7 +294,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 	struct mx25_gcq_priv *priv;
 	struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *mem;
 	int ret;
 	int i;
@@ -305,8 +304,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 
 	priv = iio_priv(indio_dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mem = devm_ioremap_resource(dev, res);
+	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
 		return PTR_ERR(mem);
 
Signature · 1 line
2.17.1
maintainer
#3 lore raw
Quoted 7 lines · On Sun, 12 Apr 2020 19:20:20 +0530 Aishwarya R <[email protected]> wrote:

From: Aishwarya Ramakrishnan <[email protected]>

Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together.It reduces boilerplate and suggested by coccinelle.

Again see earlier patches for comments but applied anyway to save myself time.

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/iio/adc/fsl-imx25-gcq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/fsl-imx25-gcq.c +1 -3
index fa71489195c6..b0a4dc88ba9b 100644
@@ -294,7 +294,6 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 	struct mx25_gcq_priv *priv;
 	struct mx25_tsadc *tsadc = dev_get_drvdata(pdev->dev.parent);
 	struct device *dev = &pdev->dev;
-	struct resource *res;
 	void __iomem *mem;
 	int ret;
 	int i;
@@ -305,8 +304,7 @@ static int mx25_gcq_probe(struct platform_device *pdev)
 
 	priv = iio_priv(indio_dev);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	mem = devm_ioremap_resource(dev, res);
+	mem = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(mem))
 		return PTR_ERR(mem);