lkml.org 
[lkml]   [2020]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] iio: adc: at91-adc: Use devm_platform_ioremap_resource
On 09/04/2020 20:41:23+0530, Aishwarya R wrote:
> Use the helper function that wraps the calls to
> platform_get_resource() and devm_ioremap_resource()
> together.
>

Please elaborate the actual value of doing that.

> Signed-off-by: Aishwarya R <aishwaryarj100@gmail.com>
> ---
> drivers/iio/adc/at91_adc.c | 5 +----
> 1 file changed, 1 insertion(+), 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);
>
> --
> 2.17.1
>

--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

\
 
 \ /
  Last update: 2020-04-09 18:01    [W:1.325 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site