summaryrefslogtreecommitdiff
path: root/drivers/iio/adc/at91_adc.c
diff options
context:
space:
mode:
authorAishwarya Ramakrishnan <aishwaryarj100@gmail.com>2020-04-12 19:26:42 +0530
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 16:56:41 +0100
commitaf5c2174ca6d9eb5d31a36fb057bbcf2aaac6f6c (patch)
tree7638afa772ced8bdb3bb07641921e2dd6829dbaa /drivers/iio/adc/at91_adc.c
parentfd1cadd6ca30dda7e9acdf501adbf33a12f0c2fd (diff)
iio: adc: at91-adc: Use devm_platform_ioremap_resource
Use the helper function that wraps the calls to platform_get_resource() and devm_ioremap_resource() together. It reduces boilerplate and suggested by coccinelle. Signed-off-by: Aishwarya Ramakrishnan <aishwaryarj100@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/at91_adc.c')
-rw-r--r--drivers/iio/adc/at91_adc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index abe99856c823..0368b6dc6d60 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -1152,7 +1152,6 @@ static int at91_adc_probe(struct platform_device *pdev)
int ret;
struct iio_dev *idev;
struct at91_adc_state *st;
- struct resource *res;
u32 reg;
idev = devm_iio_device_alloc(&pdev->dev, sizeof(struct at91_adc_state));
@@ -1182,9 +1181,7 @@ static int at91_adc_probe(struct platform_device *pdev)
if (st->irq < 0)
return -ENODEV;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-
- st->reg_base = devm_ioremap_resource(&pdev->dev, res);
+ st->reg_base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(st->reg_base))
return PTR_ERR(st->reg_base);