Skip to contentSkip to conversation

iio: adc: meson_saradc: use devm_platform_ioremap_resource

PATCH In review [email protected] 2 participants 3 messages Oct 13, 2019 – Oct 18, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 iio: adc: meson_saradc: use devm_platform_ioremap_resource

From: Jonathan Cameron <[email protected]>

Avoid local boilerplate.
Suggested by coccinelle via coccicheck.
CHECK drivers/iio/adc/meson_saradc.c
drivers/iio/adc/meson_saradc.c:1218:1-5: WARNING: Use devm_platform_ioremap_resource for base

Cc Martin Blumenstingl <[email protected]>
Cc Neil Armstrong <[email protected]>
---
 drivers/iio/adc/meson_saradc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/iio/adc/meson_saradc.c +1 -3
index 7b28d045d271..256048baf5d0 100644
@@ -1187,7 +1187,6 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
 	const struct meson_sar_adc_data *match_data;
 	struct meson_sar_adc_priv *priv;
 	struct iio_dev *indio_dev;
-	struct resource *res;
 	void __iomem *base;
 	int irq, ret;
 
@@ -1214,8 +1213,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
 	indio_dev->modes = INDIO_DIRECT_MODE;
 	indio_dev->info = &meson_sar_adc_iio_info;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
Signature · 1 line
2.23.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Sun, Oct 13, 2019 at 5:40 PM <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

Avoid local boilerplate.
Suggested by coccinelle via coccicheck.
CHECK drivers/iio/adc/meson_saradc.c
drivers/iio/adc/meson_saradc.c:1218:1-5: WARNING: Use devm_platform_ioremap_resource for base

Cc Martin Blumenstingl <[email protected]>
Cc Neil Armstrong <[email protected]>

thank you for this cleanup!

Martin

author maintainer Applied
#2 lore raw
Quoted 9 lines · On Sun, 13 Oct 2019 23:05:12 +0200 Martin Blumenstingl…
Quoted 8 lines · On Sun, Oct 13, 2019 at 5:40 PM <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

Avoid local boilerplate.
Suggested by coccinelle via coccicheck.
CHECK drivers/iio/adc/meson_saradc.c
drivers/iio/adc/meson_saradc.c:1218:1-5: WARNING: Use devm_platform_ioremap_resource for base

Quoted 7 lines
Quoted 3 lines
Cc Martin Blumenstingl <[email protected]>
Cc Neil Armstrong <[email protected]>

thank you for this cleanup!

Applied,

Thanks,

Jonathan

Quoted 2 lines

Martin