Re: [PATCH] iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing

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

 



On Mon, 29 Apr 2019 17:24:09 +0200
Geert Uytterhoeven <geert+renesas@xxxxxxxxx> wrote:

> devm_iio_device_alloc() can only fail due to a memory or IDA allocation
> failure.  Hence there is no need to print a message, as the memory
> allocation or IIO core code already takes care of that.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
I'm not totally sure there aren't any paths which can result in an
error without message, but they are at least pretty unlikely 
so I'm happy to take this.

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan


> ---
>  drivers/iio/adc/rcar-gyroadc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c
> index 2c0d0316d149707f..2d685730f8673e65 100644
> --- a/drivers/iio/adc/rcar-gyroadc.c
> +++ b/drivers/iio/adc/rcar-gyroadc.c
> @@ -485,10 +485,8 @@ static int rcar_gyroadc_probe(struct platform_device *pdev)
>  	int ret;
>  
>  	indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
> -	if (!indio_dev) {
> -		dev_err(dev, "Failed to allocate IIO device.\n");
> +	if (!indio_dev)
>  		return -ENOMEM;
> -	}
>  
>  	priv = iio_priv(indio_dev);
>  	priv->dev = dev;




[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