media: adv7180: Only request valids IRQs
authorRicardo Ribalda <ribalda@chromium.org>
Wed, 10 Apr 2024 21:54:42 +0000 (21:54 +0000)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 15 Apr 2024 11:42:39 +0000 (13:42 +0200)
i2c_device_probe(), seems to assume that irq = 0 means that there is no
irq to request.

The driver also believes that on the clean path. So lets be consistent
here.

Also make smatch happy.

Fix:
drivers/media/i2c/adv7180.c:1526 adv7180_probe() warn: 'client->irq' from request_threaded_irq() not released on lines: 1526

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/adv7180.c

index 4829cbe3241986f5a1760bfd6d4428f68f314b56..819ff9f7c90fea9d92550fa1282a0b8085d7f3df 100644 (file)
@@ -1486,7 +1486,7 @@ static int adv7180_probe(struct i2c_client *client)
        if (ret)
                goto err_media_entity_cleanup;
 
-       if (state->irq) {
+       if (state->irq > 0) {
                ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
                                           IRQF_ONESHOT | IRQF_TRIGGER_FALLING,
                                           KBUILD_MODNAME, state);