]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/hid/i2c-hid/i2c-hid.c
HID: i2c-hid: exit if the IRQ is not valid
[mirror_ubuntu-artful-kernel.git] / drivers / hid / i2c-hid / i2c-hid.c
index 4cd606c0d89c1f3a349532b1778af18f0d93010a..fe6b4e0eab4a64f52f6d2568fe8fac4ab14af5c9 100644 (file)
@@ -956,6 +956,13 @@ static int i2c_hid_probe(struct i2c_client *client,
                return -EINVAL;
        }
 
+       if (client->irq < 0) {
+               if (client->irq != -EPROBE_DEFER)
+                       dev_err(&client->dev,
+                               "HID over i2c doesn't have a valid IRQ\n");
+               return client->irq;
+       }
+
        ihid = kzalloc(sizeof(struct i2c_hid), GFP_KERNEL);
        if (!ihid)
                return -ENOMEM;