Am Dienstag 03 Juni 2008 20:45:47 schrieb Ville Syrjala:
quoted hunk ↗ jump to hunk
+static int ati_remote2_open(struct input_dev *idev)
+{
+ struct ati_remote2 *ar2 = input_get_drvdata(idev);
+ int r;
+
+ dev_dbg(&ar2->intf[0]->dev, "%s()\n", __FUNCTION__);
+
+ r = usb_autopm_get_interface(ar2->intf[0]);
+ if (r) {
+ dev_err(&ar2->intf[0]->dev,
+ "%s(): usb_autopm_get_interface() = %d\n", __FUNCTION__, r);
+ goto fail1;
+ }
+ r = usb_autopm_get_interface(ar2->intf[1]);
+ if (r) {
+ dev_err(&ar2->intf[1]->dev,
+ "%s(): usb_autopm_get_interface() = %d\n", __FUNCTION__, r);
+ goto fail2;
+ }
If you have two interfaces on one device upping the count for one of them
is enough.
+
+ mutex_lock(&ati_remote2_mutex);
Too late. You can race with disconnect()
And you should set needs_remote_wakeup.
Regards
Oliver