Commit 5f401ef0 authored by Jonathan Cameron's avatar Jonathan Cameron

iio: adc: meson_saradc: use devm_platform_ioremap_resource

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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 528e39b8
...@@ -1187,7 +1187,6 @@ static int meson_sar_adc_probe(struct platform_device *pdev) ...@@ -1187,7 +1187,6 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
const struct meson_sar_adc_data *match_data; const struct meson_sar_adc_data *match_data;
struct meson_sar_adc_priv *priv; struct meson_sar_adc_priv *priv;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
struct resource *res;
void __iomem *base; void __iomem *base;
int irq, ret; int irq, ret;
...@@ -1214,8 +1213,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev) ...@@ -1214,8 +1213,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &meson_sar_adc_iio_info; indio_dev->info = &meson_sar_adc_iio_info;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); base = devm_platform_ioremap_resource(pdev, 0);
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base)) if (IS_ERR(base))
return PTR_ERR(base); return PTR_ERR(base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment