iio: fix drivers that use 0 as a valid IRQ in client->irq (part 2)
authorOctavian Purdila <octavian.purdila@intel.com>
Wed, 23 Sep 2015 09:02:00 +0000 (12:02 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sat, 3 Oct 2015 10:02:37 +0000 (11:02 +0100)
Since commit dab472eb931bc291 ("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>
drivers/iio/accel/stk8312.c
drivers/iio/accel/stk8ba50.c
drivers/iio/light/stk3310.c

index c764af284c947ed103c08ce0e3ecf365e6f80077..a57869400b1ae23f53e90a054646f0ca82e5579c 100644 (file)
@@ -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,
index 80f77d8704b5bf29fdc857a8b5f548a9a24a9f47..a59f5d87ae3ad6c763d00b22a610db31e5f471cd 100644 (file)
@@ -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,
index 013b21779db993eb45da6119489bdcd729433d6b..f45b06bcf6ae69577157ecbb472a28673e4cfa42 100644 (file)
@@ -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,
This page took 0.026715 seconds and 5 git commands to generate.