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>
This commit is contained in:
Angus Gardner 2026-05-04 19:20:57 +10:00 committed by Jonathan Cameron
parent b4e9ede52a
commit 19f2c27251

View File

@ -392,10 +392,8 @@ static int ad9834_probe(struct spi_device *spi)
return dev_err_probe(&spi->dev, ret, "Failed to enable specified AVDD supply\n");
indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
if (!indio_dev) {
ret = -ENOMEM;
return ret;
}
if (!indio_dev)
return -ENOMEM;
st = iio_priv(indio_dev);
mutex_init(&st->lock);
st->mclk = devm_clk_get_enabled(&spi->dev, NULL);