iio: mb1232: relax return value check for IRQ get

fwnode_irq_get() was changed to not return 0 anymore.

Drop check for return value 0.

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/9e18cf49a8bb581a84c3fa548ea577e2a3eb840d.1690890774.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Matti Vaittinen 2023-08-01 15:02:10 +03:00 committed by Jonathan Cameron
parent c09ddcdd4d
commit 1402913c92

View File

@ -76,7 +76,7 @@ static s16 mb1232_read_distance(struct mb1232_data *data)
goto error_unlock; goto error_unlock;
} }
if (data->irqnr >= 0) { if (data->irqnr > 0) {
/* it cannot take more than 100 ms */ /* it cannot take more than 100 ms */
ret = wait_for_completion_killable_timeout(&data->ranging, ret = wait_for_completion_killable_timeout(&data->ranging,
HZ/10); HZ/10);
@ -212,10 +212,7 @@ static int mb1232_probe(struct i2c_client *client)
init_completion(&data->ranging); init_completion(&data->ranging);
data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0); data->irqnr = fwnode_irq_get(dev_fwnode(&client->dev), 0);
if (data->irqnr <= 0) { if (data->irqnr > 0) {
/* usage of interrupt is optional */
data->irqnr = -1;
} else {
ret = devm_request_irq(dev, data->irqnr, mb1232_handle_irq, ret = devm_request_irq(dev, data->irqnr, mb1232_handle_irq,
IRQF_TRIGGER_FALLING, id->name, indio_dev); IRQF_TRIGGER_FALLING, id->name, indio_dev);
if (ret < 0) { if (ret < 0) {