Skip to contentSkip to conversation

disconnect in ati_remote2

DISCUSSION Oliver Neukum 2 participants 2 messages Jul 2, 2008 – Jul 3, 2008 1 message not in the archive HID

lore
Share & tools
lore
#0 lore raw

Hi,

this doesn't look quite right. Somebody might use sysfs or usbfs to disconnect only one interface. In that case you should give up the other interface, not depending on the first interface being disconnected.

Regards
Oliver

static void ati_remote2_disconnect(struct usb_interface *interface)

{
	struct ati_remote2 *ar2;
	struct usb_host_interface *alt = interface->cur_altsetting;

	if (alt->desc.bInterfaceNumber)
		return;

	ar2 = usb_get_intfdata(interface);
	usb_set_intfdata(interface, NULL);

	input_unregister_device(ar2->idev);

	ati_remote2_urb_cleanup(ar2);

	usb_driver_release_interface(&ati_remote2_driver, ar2->intf[1]);

	kfree(ar2);
}

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 200807022331.44288.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 5 lines · Oliver Neukum

Hi,

this doesn't look quite right. Somebody might use sysfs or usbfs to disconnect only one interface. In that case you should give up the other interface, not depending on the first interface being disconnected.

I never considered the possibility of disconnecting just one interface. I'll put it on my TODO list for the future.

Signature · 7 lines
Ville Syrjälä
[email protected]
http://www.sci.fi/~syrjala/
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html