diff mbox series

iio: adc: meson_saradc: use devm_platform_ioremap_resource

Message ID 20191013153759.1840761-1-jic23@kernel.org (mailing list archive)
State New, archived
Headers show
Series iio: adc: meson_saradc: use devm_platform_ioremap_resource | expand

Commit Message

Jonathan Cameron Oct. 13, 2019, 3:37 p.m. UTC
From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
---
 drivers/iio/adc/meson_saradc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Martin Blumenstingl Oct. 13, 2019, 9:05 p.m. UTC | #1
On Sun, Oct 13, 2019 at 5:40 PM <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> 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
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>

thank you for this cleanup!


Martin
Jonathan Cameron Oct. 18, 2019, 7:01 p.m. UTC | #2
On Sun, 13 Oct 2019 23:05:12 +0200
Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote:

> On Sun, Oct 13, 2019 at 5:40 PM <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > 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
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> > Cc: Neil Armstrong <narmstrong@baylibre.com>  
> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> 
> thank you for this cleanup!
> 
Applied,

Thanks,

Jonathan

> 
> Martin
diff mbox series

Patch

diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 7b28d045d271..256048baf5d0 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -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);