Commit c176becd authored by Octavian Purdila's avatar Octavian Purdila Committed by Jonathan Cameron

iio: fix drivers that consider 0 as a valid IRQ in client->irq

Since patch "i2c / ACPI: Use 0 to indicate that device does not have
interrupt assigned" [1], 0 is not a valid i2c client irq anymore, so
change all driver's checks accordingly.

The same issue occurs when the device is instantiated via device tree
with no IRQ, or from the i2c sysfs interface, even before the patch
above.

[1] http://lkml.kernel.org/g/<1430908148-201129-3-git-send-email-mika.westerberg@linux.intel.com>
Signed-off-by: default avatarOctavian Purdila <octavian.purdila@intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent d9abc615
...@@ -1670,7 +1670,7 @@ static int bmc150_accel_probe(struct i2c_client *client, ...@@ -1670,7 +1670,7 @@ static int bmc150_accel_probe(struct i2c_client *client,
if (client->irq < 0) if (client->irq < 0)
client->irq = bmc150_accel_gpio_probe(client, data); client->irq = bmc150_accel_gpio_probe(client, data);
if (client->irq >= 0) { if (client->irq > 0) {
ret = devm_request_threaded_irq( ret = devm_request_threaded_irq(
&client->dev, client->irq, &client->dev, client->irq,
bmc150_accel_irq_handler, bmc150_accel_irq_handler,
......
...@@ -1240,7 +1240,7 @@ static int kxcjk1013_probe(struct i2c_client *client, ...@@ -1240,7 +1240,7 @@ static int kxcjk1013_probe(struct i2c_client *client,
if (client->irq < 0) if (client->irq < 0)
client->irq = kxcjk1013_gpio_probe(client, data); client->irq = kxcjk1013_gpio_probe(client, data);
if (client->irq >= 0) { if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq, ret = devm_request_threaded_irq(&client->dev, client->irq,
kxcjk1013_data_rdy_trig_poll, kxcjk1013_data_rdy_trig_poll,
kxcjk1013_event_handler, kxcjk1013_event_handler,
......
...@@ -1149,7 +1149,7 @@ static int mma9553_probe(struct i2c_client *client, ...@@ -1149,7 +1149,7 @@ static int mma9553_probe(struct i2c_client *client,
if (client->irq < 0) if (client->irq < 0)
client->irq = mma9553_gpio_probe(client); client->irq = mma9553_gpio_probe(client);
if (client->irq >= 0) { if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq, ret = devm_request_threaded_irq(&client->dev, client->irq,
mma9553_irq_handler, mma9553_irq_handler,
mma9553_event_handler, mma9553_event_handler,
......
...@@ -1363,7 +1363,7 @@ static int kmx61_probe(struct i2c_client *client, ...@@ -1363,7 +1363,7 @@ static int kmx61_probe(struct i2c_client *client,
if (client->irq < 0) if (client->irq < 0)
client->irq = kmx61_gpio_probe(client, data); client->irq = kmx61_gpio_probe(client, data);
if (client->irq >= 0) { if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq, ret = devm_request_threaded_irq(&client->dev, client->irq,
kmx61_data_rdy_trig_poll, kmx61_data_rdy_trig_poll,
kmx61_event_handler, kmx61_event_handler,
...@@ -1445,10 +1445,10 @@ static int kmx61_probe(struct i2c_client *client, ...@@ -1445,10 +1445,10 @@ static int kmx61_probe(struct i2c_client *client,
err_iio_unregister_acc: err_iio_unregister_acc:
iio_device_unregister(data->acc_indio_dev); iio_device_unregister(data->acc_indio_dev);
err_buffer_cleanup_mag: err_buffer_cleanup_mag:
if (client->irq >= 0) if (client->irq > 0)
iio_triggered_buffer_cleanup(data->mag_indio_dev); iio_triggered_buffer_cleanup(data->mag_indio_dev);
err_buffer_cleanup_acc: err_buffer_cleanup_acc:
if (client->irq >= 0) if (client->irq > 0)
iio_triggered_buffer_cleanup(data->acc_indio_dev); iio_triggered_buffer_cleanup(data->acc_indio_dev);
err_trigger_unregister_motion: err_trigger_unregister_motion:
iio_trigger_unregister(data->motion_trig); iio_trigger_unregister(data->motion_trig);
...@@ -1472,7 +1472,7 @@ static int kmx61_remove(struct i2c_client *client) ...@@ -1472,7 +1472,7 @@ static int kmx61_remove(struct i2c_client *client)
iio_device_unregister(data->acc_indio_dev); iio_device_unregister(data->acc_indio_dev);
iio_device_unregister(data->mag_indio_dev); iio_device_unregister(data->mag_indio_dev);
if (client->irq >= 0) { if (client->irq > 0) {
iio_triggered_buffer_cleanup(data->acc_indio_dev); iio_triggered_buffer_cleanup(data->acc_indio_dev);
iio_triggered_buffer_cleanup(data->mag_indio_dev); iio_triggered_buffer_cleanup(data->mag_indio_dev);
iio_trigger_unregister(data->acc_dready_trig); iio_trigger_unregister(data->acc_dready_trig);
......
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