提交 a83695a6 编写于 作者: M Marcus Folkesson 提交者: Jonathan Cameron

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: 08a65f61 ("iio: adc: mcp3911: add support for interrupts")
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NMarcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20220927092537.94663-1-marcus.folkesson@gmail.comSigned-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 7578847b
...@@ -496,7 +496,7 @@ static int mcp3911_probe(struct spi_device *spi) ...@@ -496,7 +496,7 @@ static int mcp3911_probe(struct spi_device *spi)
indio_dev->name, indio_dev->name,
iio_device_id(indio_dev)); iio_device_id(indio_dev));
if (!adc->trig) if (!adc->trig)
return PTR_ERR(adc->trig); return -ENOMEM;
adc->trig->ops = &mcp3911_trigger_ops; adc->trig->ops = &mcp3911_trigger_ops;
iio_trigger_set_drvdata(adc->trig, adc); iio_trigger_set_drvdata(adc->trig, adc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册