Skip to content

Commit

Permalink
iio: fix drivers that use 0 as a valid IRQ in client->irq (part 2)
Browse files Browse the repository at this point in the history
Since commit dab472e ("i2c / ACPI: Use 0 to indicate that
device does not have interrupt assigned") 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.

Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Octavian Purdila authored and Jonathan Cameron committed Oct 3, 2015
1 parent 1de953e commit 6839c1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/iio/accel/stk8312.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ static int stk8312_probe(struct i2c_client *client,
if (client->irq < 0)
client->irq = stk8312_gpio_probe(client);

if (client->irq >= 0) {
if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq,
stk8312_data_rdy_trig_poll,
NULL,
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/accel/stk8ba50.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static int stk8ba50_probe(struct i2c_client *client,
if (client->irq < 0)
client->irq = stk8ba50_gpio_probe(client);

if (client->irq >= 0) {
if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq,
stk8ba50_data_rdy_trig_poll,
NULL,
Expand Down
2 changes: 1 addition & 1 deletion drivers/iio/light/stk3310.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ static int stk3310_probe(struct i2c_client *client,
}
}

if (client->irq >= 0) {
if (client->irq > 0) {
ret = devm_request_threaded_irq(&client->dev, client->irq,
stk3310_irq_handler,
stk3310_irq_event_handler,
Expand Down

0 comments on commit 6839c1b

Please sign in to comment.