iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing
diff mbox series

Message ID 20190429152409.23081-1-geert+renesas@glider.be
State New
Headers show
Series
  • iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing
Related show

Commit Message

Geert Uytterhoeven April 29, 2019, 3:24 p.m. UTC
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@glider.be>
---
 drivers/iio/adc/rcar-gyroadc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jonathan Cameron May 5, 2019, 11:48 a.m. UTC | #1
On Mon, 29 Apr 2019 17:24:09 +0200
Geert Uytterhoeven <geert+renesas@glider.be> 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@glider.be>
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;

Patch
diff mbox series

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;