Message ID | 20190429152409.23081-1-geert+renesas@glider.be (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: adc: rcar-gyroadc: Remove devm_iio_device_alloc() error printing | expand |
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;
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;
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(-)