Re: [ANNOUNCE] hotplug-ng 002 release

From: Greg KH
Date: Sat May 14 2005 - 01:00:58 EST


On Sat, May 14, 2005 at 01:21:33AM +0200, Per Svennerbrandt wrote:
> * On Fri, 13 May 2005, Greg KH (greg@xxxxxxxxx) wrote:
> > Ok, as you never posted your patch, I had to do it myself :)
>
> Oh, crap! Seems like I'm forever doomed to be sitting on my patches for
> six months thinking they arn't good enough, only to then repeatedly
> getting beaten by couple of hours when finally deciding on submitting
> them then... ;) ;)
>
> I guess I'l just have to dedicate more time if I'm ever going to get any
> code into the kernel.

Or just send those patches earlier :)

> This is pretty much identical to my patch except mine also converts PCI
> into using add_hotplug_env_var().

That would be nice to do, but it would have been doing 2 things in one
patch, not good.

> > +static ssize_t show_modalias(struct device *dev, char *buf)
> > +{
> > + struct usb_interface *intf;
> > + struct usb_device *udev;
> > +
> > + intf = to_usb_interface(dev);
> > + udev = interface_to_usbdev(intf);
> > + if (udev->descriptor.bDeviceClass == 0) {
> > + struct usb_host_interface *alt = intf->cur_altsetting;
> > +
> > + return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02Xic%02Xisc%02Xip%02X\n",
> > + le16_to_cpu(udev->descriptor.idVendor),
> > + le16_to_cpu(udev->descriptor.idProduct),
> > + le16_to_cpu(udev->descriptor.bcdDevice),
> > + udev->descriptor.bDeviceClass,
> > + udev->descriptor.bDeviceSubClass,
> > + udev->descriptor.bDeviceProtocol,
> > + alt->desc.bInterfaceClass,
> > + alt->desc.bInterfaceSubClass,
> > + alt->desc.bInterfaceProtocol);
>
> Are you sure this is correct?

Works for me :)

> I had problems with alt (intf->cur_altsetting) beeing null and actually
> ended up ignoring the interface bits altogether. I'm bretty sure the
> above will crash repeatedly on at least some of my machines.

Please let me know if it does. Did you put the modalias on the
usb_device or the interface? It belongs on the interface, as this patch
does.

cur_altsetting could be NULL pretty early in the initialization phase of
a USB device, but by the time these files are created, it should be fine
(otherwise this same check in the hotplug call would also fail, right?)

> So now that I'm not able to submit it toghether with a mixture of other,
> at least slightly, related things that I actually *do believe* have a
> small possibility of beeing accepted: How do I get my request_modalias
> patch in? ;) ;)

Send them on, let's see what you have, and we can take it from there.

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/