On Mon, 12 Jun 2006, Greg KH wrote: > One comment thought: > > > @@ -516,14 +756,14 @@ static int usb_uevent(struct device *dev > > /* driver is often null here; dev_dbg() would oops */ > > pr_debug ("usb %s: uevent\n", dev->bus_id); > > > > - /* Must check driver_data here, as on remove driver is always NULL */ > > - if ((dev->driver == &usb_generic_driver) || > > - (dev->driver_data == &usb_generic_driver_data)) > > - return 0; > > - > > - intf = to_usb_interface(dev); > > - usb_dev = interface_to_usbdev (intf); > > - alt = intf->cur_altsetting; > > + if (is_usb_device(dev)) { > > + usb_dev = to_usb_device(dev); > > + alt = NULL; > > + } else { > > + intf = to_usb_interface(dev); > > + usb_dev = interface_to_usbdev (intf); > > + alt = intf->cur_altsetting; > > + } > > > > if (usb_dev->devnum < 0) { > > pr_debug ("usb %s: already deleted?\n", dev->bus_id); > > @@ -566,15 +806,22 @@ static int usb_uevent(struct device *dev > > usb_dev->descriptor.bDeviceProtocol)) > > return -ENOMEM; > > > > - if (add_uevent_var(envp, num_envp, &i, > > + if (is_usb_device(dev)) { > > + > > + /* FIXME: What is an appropriate MODALIAS line for a > > + * USB device (not interface)? */ > > There isn't one.
Clearly it doesn't matter until people start writing alternate device drivers. > In fact, you shouldn't be adding _any_ usb stuff for uevents for usb > devices, we only care about interfaces. Why did you change this? Well, the uevent _was_ getting generated -- that's done by the driver core -- it just didn't have any USB information added in to the environment variables. It turns out that in fact we _do_ care now about adding USB devices. This is because of the new power-budgeting restrictions; people sometimes want to install a configuration automatically (in a udev script) even though it violates the power budget. Since by default no configuration is selected there _are_ no interfaces registered, so the only event to trigger from is the one corresponding to the device itself. Alan Stern _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel