Patchwork [U-Boot] usb, composite: after unregister gadget driver set composite to NULL

login
register
mail settings
Submitter Heiko Schocher
Date June 4, 2013, 9:21 a.m.
Message ID <1370337692-16693-1-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/248513/
State Awaiting Upstream
Delegated to: Marek Vasut
Headers show

Comments

Heiko Schocher - June 4, 2013, 9:21 a.m.
Without this, second usb_composite_register() call fails always
with -EINVAL.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Vasut <marex@denx.de>
---
 drivers/usb/gadget/composite.c | 1 +
 1 Datei geändert, 1 Zeile hinzugefügt(+)
Łukasz Majewski - June 4, 2013, 10:17 a.m.
Hi Heiko,

> Without this, second usb_composite_register() call fails always
> with -EINVAL.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
> ---
>  drivers/usb/gadget/composite.c | 1 +
>  1 Datei geändert, 1 Zeile hinzugefügt(+)
> 
> diff --git a/drivers/usb/gadget/composite.c
> b/drivers/usb/gadget/composite.c index 0716e52..f867793 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1099,4 +1099,5 @@ void usb_composite_unregister(struct
> usb_composite_driver *driver) if (composite != driver)
>  		return;
>  	usb_gadget_unregister_driver(&composite_driver);
> +	composite = NULL;

Thanks for spotting.

>  }

Reviewed-by: Lukasz Majewski <l.majewski@samsung.com>
Marek Vasut - June 9, 2013, 8:06 p.m.
Dear Heiko Schocher,

> Without this, second usb_composite_register() call fails always
> with -EINVAL.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: Marek Vasut <marex@denx.de>

Applied, thanks.

Best regards,
Marek Vasut

Patch

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 0716e52..f867793 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1099,4 +1099,5 @@  void usb_composite_unregister(struct usb_composite_driver *driver)
 	if (composite != driver)
 		return;
 	usb_gadget_unregister_driver(&composite_driver);
+	composite = NULL;
 }