mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
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:
parent
b4e9ede52a
commit
19f2c27251
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user