Re: [PATCH 2/2] ati_remote2: Add autosuspend support

From
Oliver Neukum <oliver@neukum.org>
Date
2008-06-03 20:10:59
Reply to
Ville Syrjala, 2008-06-03
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
Thread (3 messages) 3 messages, 3 authors, last reply 2008-06-03
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help