Commit debf6d84 authored by Roberta Dobrescu's avatar Roberta Dobrescu Committed by Jonathan Cameron

iio: accel: mma9551: Check gpiod_to_irq return value

The return value of gpiod_to_irq should be checked before giving
it to devm_request_threaded_irq in order to not pass an error
code in case it fails.
Signed-off-by: default avatarRoberta Dobrescu <roberta.dobrescu@gmail.com>
Reviewed-by: default avatarVlad Dogaru <vlad.dogaru@intel.com>
Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 4a428bf3
......@@ -425,7 +425,11 @@ static int mma9551_gpio_probe(struct iio_dev *indio_dev)
return PTR_ERR(gpio);
}
data->irqs[i] = gpiod_to_irq(gpio);
ret = gpiod_to_irq(gpio);
if (ret < 0)
return ret;
data->irqs[i] = ret;
ret = devm_request_threaded_irq(dev, data->irqs[i],
NULL, mma9551_event_handler,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment