unsigned long flags; /* device flags */
- int irq; /* the interrupt line irq */
-
wait_queue_head_t wait; /* For waiting the interrupt */
};
return ret;
}
- ihid->irq = client->irq;
-
return 0;
}
hid = hid_allocate_device();
if (IS_ERR(hid)) {
ret = PTR_ERR(hid);
- goto err;
+ goto err_irq;
}
ihid->hid = hid;
err_mem_free:
hid_destroy_device(hid);
-err:
- if (ihid->irq)
- free_irq(ihid->irq, ihid);
+err_irq:
+ free_irq(client->irq, ihid);
+err:
i2c_hid_free_buffers(ihid);
kfree(ihid);
return ret;
static int i2c_hid_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
- struct i2c_hid *ihid = i2c_get_clientdata(client);
if (device_may_wakeup(&client->dev))
- enable_irq_wake(ihid->irq);
+ enable_irq_wake(client->irq);
/* Save some power */
i2c_hid_set_power(client, I2C_HID_PWR_SLEEP);