linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing
@ 2019-04-29 15:24 Geert Uytterhoeven
  2019-05-05 11:48 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2019-04-29 15:24 UTC (permalink / raw)
  To: Marek Vasut, Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, linux-renesas-soc, Geert Uytterhoeven

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(-)

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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing
  2019-04-29 15:24 [PATCH] iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing Geert Uytterhoeven
@ 2019-05-05 11:48 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2019-05-05 11:48 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Marek Vasut, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, linux-renesas-soc

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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-05 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 15:24 [PATCH] iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing Geert Uytterhoeven
2019-05-05 11:48 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).