iio: adc: max1027: Drop extra warning message
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 21 Sep 2021 11:53:54 +0000 (13:53 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Tue, 19 Oct 2021 07:27:33 +0000 (08:27 +0100)
Memory allocation errors automatically trigger the right logs, no need
to have our own.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20210921115408.66711-3-miquel.raynal@bootlin.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/max1027.c

index 372f2ca..9eaeb17 100644 (file)
@@ -446,10 +446,8 @@ static int max1027_probe(struct spi_device *spi)
        st->buffer = devm_kmalloc_array(&indio_dev->dev,
                                        indio_dev->num_channels, 2,
                                        GFP_KERNEL);
-       if (!st->buffer) {
-               dev_err(&indio_dev->dev, "Can't allocate buffer\n");
+       if (!st->buffer)
                return -ENOMEM;
-       }
 
        if (spi->irq) {
                ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev,