Thread (1 message) 1 message, 1 author, 2009-01-14

Re: [patch v2] net/usb: remove err() messages in few drivers

From: Oliver Neukum <hidden>
Date: 2009-01-14 08:09:43

Am Wednesday 14 January 2009 01:22:26 schrieb Alexey Klimov:
quoted
Use the interface passed into probe():  dev_err(&intf->dev, ...) etc
A USB driver is fundamentally a driver for a device's interfaces.
Therefore the interface's device struct is the obviously correct choice.
Well, in few v4l-dvb drivers successfully used &radio->usbdev->dev in
debug messages and that doesn't look wrong.
That will not allow you to identify which interface caused the message.
 
Hmm, i see that struct usb_interface passed to probe function for
example, and here in catc_irq_done struct urb passed, and then we have
struct catc. So, messages based on catc->usbdev->dev. I can switch to
&catc->netdev->dev when it's safe to do, right?
You cannot. The point of passing a device pointer is to identify the device.
The device in the network view and the USB view is not identical. You
have to pick one choice and stick with it and if for some reason that is not
possible you cannot use this debugging functions.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help