diff options
author | Marcus Folkesson <[email protected]> | 2022-09-27 11:25:37 +0200 |
---|---|---|
committer | Jonathan Cameron <[email protected]> | 2022-10-17 08:51:26 +0100 |
commit | a83695a666eb3541873c3c9734ec4e1d10ca2d7f (patch) | |
tree | 8bb0b68cd25aa7ec7c1e076bbe29072f0ece337b | |
parent | 7578847b5949db3a75163908bd99c46d27e8b19f (diff) |
iio: adc: mcp3911: return proper error code on failure to allocate trigger
smatch warnings:
drivers/iio/adc/mcp3911.c:441 mcp3911_probe() warn: passing zero to 'PTR_ERR'
Fixes: 08a65f61db69 ("iio: adc: mcp3911: add support for interrupts")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Marcus Folkesson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r-- | drivers/iio/adc/mcp3911.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/mcp3911.c b/drivers/iio/adc/mcp3911.c index 015a9ffdb26a..7f0b37994fe5 100644 --- a/drivers/iio/adc/mcp3911.c +++ b/drivers/iio/adc/mcp3911.c @@ -496,7 +496,7 @@ static int mcp3911_probe(struct spi_device *spi) indio_dev->name, iio_device_id(indio_dev)); if (!adc->trig) - return PTR_ERR(adc->trig); + return -ENOMEM; adc->trig->ops = &mcp3911_trigger_ops; iio_trigger_set_drvdata(adc->trig, adc); |