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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Wednesday 14 January 2009 11:40:11 schrieb Alexey Klimov:
> Thanks, David and Oliver
> 
> Don't you mind if i'll use such approach(to_usb_interface) ?
> 
> Example:
> if ((res = usb_submit_urb(catc->rx_urb, GFP_ATOMIC)) < 0) {
>                                 struct usb_interface *intf =
> to_usb_interface(&catc->usbdev->dev);
>                                 dev_err(&intf->dev, "submit(rx_urb)
> status %d\n", res);
>                         }
> 
> 


I actually do mind a lot for the simple reason that this code will
horribly crash and burn.

You cannot do that. One USB _device_ (with its own struct device) can
have a multitude of USB interfaces (each with struct device embedded).
There is _no_ way you can get from this:

struct catc {
	struct net_device *netdev;
	struct usb_device *usbdev;

to an interface's embedded struct device.
Please gain an understanding of the code you want to change before
you send patches that are minor enhancements and not worth introducing
bugs for. These drivers are working as they are right now.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux