mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-26 14:40:41 +00:00
usb: mv_udc: Clean up the initial variable check
Clean up the code that checks the validity of a USB gadget driver in usb_gadget_register_driver(). Moreover, limit the speed of the driver to either FULL or HIGH, this is more precise and once we have xHCI support, also more correct. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Lei Wen <leiwen@marvell.com> Cc: Otavio Salvador <otavio@ossystems.com.br> Cc: Stefano Babic <sbabic@denx.de>
This commit is contained in:
parent
be7ed2533d
commit
d76630386d
1 changed files with 5 additions and 6 deletions
|
@ -471,13 +471,12 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
|
|||
struct mv_udc *udc;
|
||||
int ret;
|
||||
|
||||
if (!driver
|
||||
|| driver->speed < USB_SPEED_FULL
|
||||
|| !driver->bind
|
||||
|| !driver->setup) {
|
||||
DBG("bad parameter.\n");
|
||||
if (!driver)
|
||||
return -EINVAL;
|
||||
if (!driver->bind || !driver->setup || !driver->disconnect)
|
||||
return -EINVAL;
|
||||
if (driver->speed != USB_SPEED_FULL && driver->speed != USB_SPEED_HIGH)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = usb_lowlevel_init(0, (void **)&controller.ctrl);
|
||||
if (ret)
|
||||
|
|
Loading…
Reference in a new issue