diff mbox series

iio: adc: xilinix-xadc: use devm_platform_ioremap_resource

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

Commit Message

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

Reduces local boilerplate.
Suggested by coccinelle.
 CHECK   drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc-core.c:1184:1-11: WARNING: Use devm_platform_ioremap_resource for xadc -> base

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Manish Narani <manish.narani@xilinx.com>
Cc: Sven Van Asbroeck <thesven73@gmail.com>
---
 drivers/iio/adc/xilinx-xadc-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Sven Van Asbroeck Oct. 14, 2019, 7:56 p.m. UTC | #1
On Sun, Oct 13, 2019 at 12:50 PM <jic23@kernel.org> wrote:
>
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Reduces local boilerplate.
> Suggested by coccinelle.
>  CHECK   drivers/iio/adc/xilinx-xadc-core.c
> drivers/iio/adc/xilinx-xadc-core.c:1184:1-11: WARNING: Use devm_platform_ioremap_resource for xadc -> base
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Manish Narani <manish.narani@xilinx.com>
> Cc: Sven Van Asbroeck <thesven73@gmail.com>
> ---
>  drivers/iio/adc/xilinx-xadc-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

Looks good to me:

Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>
Jonathan Cameron Oct. 18, 2019, 7:06 p.m. UTC | #2
On Mon, 14 Oct 2019 15:56:36 -0400
Sven Van Asbroeck <thesven73@gmail.com> wrote:

> On Sun, Oct 13, 2019 at 12:50 PM <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > Reduces local boilerplate.
> > Suggested by coccinelle.
> >  CHECK   drivers/iio/adc/xilinx-xadc-core.c
> > drivers/iio/adc/xilinx-xadc-core.c:1184:1-11: WARNING: Use devm_platform_ioremap_resource for xadc -> base
> >
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Manish Narani <manish.narani@xilinx.com>
> > Cc: Sven Van Asbroeck <thesven73@gmail.com>
> > ---
> >  drivers/iio/adc/xilinx-xadc-core.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)  
> 
> Looks good to me:
> 
> Reviewed-by: Sven Van Asbroeck <TheSven73@gmail.com>

Applied,

Thanks,

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 4fd389678dba..ec227b358cd6 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1150,7 +1150,6 @@  static int xadc_probe(struct platform_device *pdev)
 	const struct of_device_id *id;
 	struct iio_dev *indio_dev;
 	unsigned int bipolar_mask;
-	struct resource *mem;
 	unsigned int conf0;
 	struct xadc *xadc;
 	int ret;
@@ -1180,8 +1179,7 @@  static int xadc_probe(struct platform_device *pdev)
 	spin_lock_init(&xadc->lock);
 	INIT_DELAYED_WORK(&xadc->zynq_unmask_work, xadc_zynq_unmask_worker);
 
-	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	xadc->base = devm_ioremap_resource(&pdev->dev, mem);
+	xadc->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(xadc->base))
 		return PTR_ERR(xadc->base);