Skip to content

Commit 19f2c27

Browse files
Angus Gardnerjic23
authored andcommitted
staging: iio: ad9834: simplify -ENOMEM return in probe
devm_iio_device_alloc() failure returns -ENOMEM via a local variable unnecessarily. Return -ENOMEM directly instead. Signed-off-by: Angus Gardner <angusg778@gmail.com> Reviewed-by: Maxwell Doose <m32285159@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent b4e9ede commit 19f2c27

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/staging/iio/frequency/ad9834.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,8 @@ static int ad9834_probe(struct spi_device *spi)
392392
return dev_err_probe(&spi->dev, ret, "Failed to enable specified AVDD supply\n");
393393

394394
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
395-
if (!indio_dev) {
396-
ret = -ENOMEM;
397-
return ret;
398-
}
395+
if (!indio_dev)
396+
return -ENOMEM;
399397
st = iio_priv(indio_dev);
400398
mutex_init(&st->lock);
401399
st->mclk = devm_clk_get_enabled(&spi->dev, NULL);

0 commit comments

Comments
 (0)