Re: [PATCH 02/49] usb: gadget: udc-core: initialize gadget->dev.driver

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

 



On Tue, 26 Feb 2013, Felipe Balbi wrote:

> if we initialize gadget->dev.driver ourselves,
> UDC drivers won't have to do the same, so we
> can remove some duplicated code.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>

There's something odd going on here that I don't understand...

> @@ -296,6 +297,7 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
>  
>  	udc->driver = driver;
>  	udc->dev.driver = &driver->driver;
> +	udc->gadget->dev.driver = &driver->driver;

Why is the same pointer assigned as the driver of two different
devices?

The assignment to udc->gadget->dev.driver looks reasonable, since here
"driver" really is a usb_gadget_driver.  But it's not a UDC driver, so
why do we have the first two lines above?

At best they are redundant.  More likely they are either wrong or 
unnecessary.

Alan Stern

--
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