Re: [PATCH] drivers: iio: adc: convert to devm_ioremap_resource()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/2013 12:06 PM, Silviu-Mihai Popescu wrote:
> Convert all uses of devm_request_and_ioremap() to the newly introduced
> devm_ioremap_resource() which provides more consistent error handling.
> 
> Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@xxxxxxxxx>
Patch number 3 doing the same thing.  I was somewhat tardy applying
the first one so sorry for wasting your time on this.

Jonathan
> ---
>  drivers/iio/adc/exynos_adc.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
> index 9f3a8ef..22d034a 100644
> --- a/drivers/iio/adc/exynos_adc.c
> +++ b/drivers/iio/adc/exynos_adc.c
> @@ -270,16 +270,16 @@ static int exynos_adc_probe(struct platform_device *pdev)
>  	info = iio_priv(indio_dev);
>  
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	info->regs = devm_request_and_ioremap(&pdev->dev, mem);
> -	if (!info->regs) {
> -		ret = -ENOMEM;
> +	info->regs = devm_ioremap_resource(&pdev->dev, mem);
> +	if (IS_ERR(info->regs)) {
> +		ret = PTR_ERR(info->regs);
>  		goto err_iio;
>  	}
>  
>  	mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -	info->enable_reg = devm_request_and_ioremap(&pdev->dev, mem);
> -	if (!info->enable_reg) {
> -		ret = -ENOMEM;
> +	info->enable_reg = devm_ioremap_resource(&pdev->dev, mem);
> +	if (IS_ERR(info->enable_reg)) {
> +		ret = PTR_ERR(info->enable_reg);
>  		goto err_iio;
>  	}
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux