On Thu, Jun 15, 2006 at 10:47:28AM -0400, Alan Stern wrote:
> On Wed, 14 Jun 2006, Greg KH wrote:
> 
> > > usb_generic doesn't bind to a device until the device is registered.  
> > > This means that all the early dev_info and dev_dbg log messages in
> > > usb_new_device, hub_port_init, and so on, don't have a device driver name.
> > > 
> > > Maybe I should replace those macros with something like "usb_info" and 
> > > "usb_dbg" that would always print "usb" for the driver name.
> > 
> > There's a patch floating around lkml that changes the way dev_* works,
> > so that if there is no driver bound, it prints the bus name.  So for
> > this, it would show "usb", which is what we want.  Try it out and if it
> > works, I'll be glad to add it.
> 
> It's bloody difficult to do any serious searches through the mailing list 
> archives.  If you know of a good way to do it, I'd like to hear what it 
> is.

Subscribe a gmail account to the mailing list, add a tag for it, and
then use gmail to search.

Or just subscribe to the list, and archive everything and use good
search tools to find things (mairix works very well).

I do both and it seems to handle all of the different situations (the
gmail one is fun to play with, but a pain to get patches out of).

> In this case, you probably mean something like this:
> 
> --- usb-2.6.orig/include/linux/device.h
> +++ usb-2.6/include/linux/device.h
> @@ -404,7 +404,8 @@ extern void firmware_unregister(struct s
>  
>  /* debugging and troubleshooting/diagnostic helpers. */
>  #define dev_printk(level, dev, format, arg...)       \
> -     printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : 
> "" , (dev)->bus_id , ## arg)
> +     printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : \
> +             (dev)->bus->name , (dev)->bus_id , ## arg)
>  
>  #ifdef DEBUG
>  #define dev_dbg(dev, format, arg...)         \
> 
> 
> Is this right?  It definitely will solve the problem I was referring to.

Yes, that's it.  I'll go add that to my trees, thanks.

Hm, need to check that the device is attached to a bus, because that's
not always true...

thanks,

greg k-h


_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to