* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
@ 2016-02-16 17:59 Semen Protsenko
2016-02-19 19:34 ` Sam Protsenko
0 siblings, 1 reply; 8+ messages in thread
From: Semen Protsenko @ 2016-02-16 17:59 UTC (permalink / raw)
To: u-boot
From: Sam Protsenko <semen.protsenko@linaro.org>
In case when usb_composite_register() failed once (for whatever reason),
it will fail further even if all conditions are correct. Example:
=> fastboot 2
Invalid Controller Index
couldn't find an available UDC
g_dnl_register: failed!, error: -19
exit not allowed from main input shell.
=> fastboot 0
g_dnl_register: failed!, error: -22
exit not allowed from main input shell.
Despite that 0 is correct index for USB controller, "fastboot 0" command
will fail, because "composite" structure wasn't cleared properly on
previous fail (on "fastboot 2" command).
This patch fixes that erroneous behavior, allowing us to use composite
even after previous failure.
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
---
drivers/usb/gadget/composite.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 60f9272..d0ee784 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1077,6 +1077,8 @@ static struct usb_gadget_driver composite_driver = {
*/
int usb_composite_register(struct usb_composite_driver *driver)
{
+ int res;
+
if (!driver || !driver->dev || !driver->bind || composite)
return -EINVAL;
@@ -1084,7 +1086,11 @@ int usb_composite_register(struct usb_composite_driver *driver)
driver->name = "composite";
composite = driver;
- return usb_gadget_register_driver(&composite_driver);
+ res = usb_gadget_register_driver(&composite_driver);
+ if (res != 0)
+ composite = NULL;
+
+ return res;
}
/**
--
2.7.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-16 17:59 [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register Semen Protsenko
@ 2016-02-19 19:34 ` Sam Protsenko
2016-02-26 19:43 ` Sam Protsenko
0 siblings, 1 reply; 8+ messages in thread
From: Sam Protsenko @ 2016-02-19 19:34 UTC (permalink / raw)
To: u-boot
+ Praneeth Bajjuri
+ Tom Rini
+ Rob Herring
On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
<semen.protsenko@linaro.org> wrote:
> From: Sam Protsenko <semen.protsenko@linaro.org>
>
> In case when usb_composite_register() failed once (for whatever reason),
> it will fail further even if all conditions are correct. Example:
>
> => fastboot 2
> Invalid Controller Index
> couldn't find an available UDC
> g_dnl_register: failed!, error: -19
> exit not allowed from main input shell.
>
> => fastboot 0
> g_dnl_register: failed!, error: -22
> exit not allowed from main input shell.
>
> Despite that 0 is correct index for USB controller, "fastboot 0" command
> will fail, because "composite" structure wasn't cleared properly on
> previous fail (on "fastboot 2" command).
>
> This patch fixes that erroneous behavior, allowing us to use composite
> even after previous failure.
>
> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> ---
> drivers/usb/gadget/composite.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 60f9272..d0ee784 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver composite_driver = {
> */
> int usb_composite_register(struct usb_composite_driver *driver)
> {
> + int res;
> +
> if (!driver || !driver->dev || !driver->bind || composite)
> return -EINVAL;
>
> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct usb_composite_driver *driver)
> driver->name = "composite";
> composite = driver;
>
> - return usb_gadget_register_driver(&composite_driver);
> + res = usb_gadget_register_driver(&composite_driver);
> + if (res != 0)
> + composite = NULL;
> +
> + return res;
> }
>
> /**
> --
> 2.7.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-19 19:34 ` Sam Protsenko
@ 2016-02-26 19:43 ` Sam Protsenko
2016-02-26 19:52 ` Marek Vasut
0 siblings, 1 reply; 8+ messages in thread
From: Sam Protsenko @ 2016-02-26 19:43 UTC (permalink / raw)
To: u-boot
On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
<semen.protsenko@linaro.org> wrote:
> + Praneeth Bajjuri
> + Tom Rini
> + Rob Herring
>
> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
> <semen.protsenko@linaro.org> wrote:
>> From: Sam Protsenko <semen.protsenko@linaro.org>
>>
>> In case when usb_composite_register() failed once (for whatever reason),
>> it will fail further even if all conditions are correct. Example:
>>
>> => fastboot 2
>> Invalid Controller Index
>> couldn't find an available UDC
>> g_dnl_register: failed!, error: -19
>> exit not allowed from main input shell.
>>
>> => fastboot 0
>> g_dnl_register: failed!, error: -22
>> exit not allowed from main input shell.
>>
>> Despite that 0 is correct index for USB controller, "fastboot 0" command
>> will fail, because "composite" structure wasn't cleared properly on
>> previous fail (on "fastboot 2" command).
>>
>> This patch fixes that erroneous behavior, allowing us to use composite
>> even after previous failure.
>>
>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>> ---
>> drivers/usb/gadget/composite.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
>> index 60f9272..d0ee784 100644
>> --- a/drivers/usb/gadget/composite.c
>> +++ b/drivers/usb/gadget/composite.c
>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver composite_driver = {
>> */
>> int usb_composite_register(struct usb_composite_driver *driver)
>> {
>> + int res;
>> +
>> if (!driver || !driver->dev || !driver->bind || composite)
>> return -EINVAL;
>>
>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct usb_composite_driver *driver)
>> driver->name = "composite";
>> composite = driver;
>>
>> - return usb_gadget_register_driver(&composite_driver);
>> + res = usb_gadget_register_driver(&composite_driver);
>> + if (res != 0)
>> + composite = NULL;
>> +
>> + return res;
>> }
>>
>> /**
>> --
>> 2.7.0
>>
bump
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-26 19:43 ` Sam Protsenko
@ 2016-02-26 19:52 ` Marek Vasut
2016-02-29 10:11 ` Lukasz Majewski
0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2016-02-26 19:52 UTC (permalink / raw)
To: u-boot
On 02/26/2016 08:43 PM, Sam Protsenko wrote:
> On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
> <semen.protsenko@linaro.org> wrote:
>> + Praneeth Bajjuri
>> + Tom Rini
>> + Rob Herring
>>
>> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
>> <semen.protsenko@linaro.org> wrote:
>>> From: Sam Protsenko <semen.protsenko@linaro.org>
>>>
>>> In case when usb_composite_register() failed once (for whatever reason),
>>> it will fail further even if all conditions are correct. Example:
>>>
>>> => fastboot 2
>>> Invalid Controller Index
>>> couldn't find an available UDC
>>> g_dnl_register: failed!, error: -19
>>> exit not allowed from main input shell.
>>>
>>> => fastboot 0
>>> g_dnl_register: failed!, error: -22
>>> exit not allowed from main input shell.
>>>
>>> Despite that 0 is correct index for USB controller, "fastboot 0" command
>>> will fail, because "composite" structure wasn't cleared properly on
>>> previous fail (on "fastboot 2" command).
>>>
>>> This patch fixes that erroneous behavior, allowing us to use composite
>>> even after previous failure.
>>>
>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>>> ---
>>> drivers/usb/gadget/composite.c | 8 +++++++-
>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
>>> index 60f9272..d0ee784 100644
>>> --- a/drivers/usb/gadget/composite.c
>>> +++ b/drivers/usb/gadget/composite.c
>>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver composite_driver = {
>>> */
>>> int usb_composite_register(struct usb_composite_driver *driver)
>>> {
>>> + int res;
>>> +
>>> if (!driver || !driver->dev || !driver->bind || composite)
>>> return -EINVAL;
>>>
>>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct usb_composite_driver *driver)
>>> driver->name = "composite";
>>> composite = driver;
>>>
>>> - return usb_gadget_register_driver(&composite_driver);
>>> + res = usb_gadget_register_driver(&composite_driver);
>>> + if (res != 0)
>>> + composite = NULL;
>>> +
>>> + return res;
>>> }
>>>
>>> /**
>>> --
>>> 2.7.0
>>>
>
> bump
>
Looks fine. Lukasz, shall I pick this myself ?
btw if this isn't applied in a week, please ping me and I will pick it
nonetheless.
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-26 19:52 ` Marek Vasut
@ 2016-02-29 10:11 ` Lukasz Majewski
2016-02-29 11:40 ` Marek Vasut
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2016-02-29 10:11 UTC (permalink / raw)
To: u-boot
Hi Marek,
> On 02/26/2016 08:43 PM, Sam Protsenko wrote:
> > On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
> > <semen.protsenko@linaro.org> wrote:
> >> + Praneeth Bajjuri
> >> + Tom Rini
> >> + Rob Herring
> >>
> >> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
> >> <semen.protsenko@linaro.org> wrote:
> >>> From: Sam Protsenko <semen.protsenko@linaro.org>
> >>>
> >>> In case when usb_composite_register() failed once (for whatever
> >>> reason), it will fail further even if all conditions are correct.
> >>> Example:
> >>>
> >>> => fastboot 2
> >>> Invalid Controller Index
> >>> couldn't find an available UDC
> >>> g_dnl_register: failed!, error: -19
> >>> exit not allowed from main input shell.
> >>>
> >>> => fastboot 0
> >>> g_dnl_register: failed!, error: -22
> >>> exit not allowed from main input shell.
> >>>
> >>> Despite that 0 is correct index for USB controller, "fastboot 0"
> >>> command will fail, because "composite" structure wasn't cleared
> >>> properly on previous fail (on "fastboot 2" command).
> >>>
> >>> This patch fixes that erroneous behavior, allowing us to use
> >>> composite even after previous failure.
> >>>
> >>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> >>> ---
> >>> drivers/usb/gadget/composite.c | 8 +++++++-
> >>> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/drivers/usb/gadget/composite.c
> >>> b/drivers/usb/gadget/composite.c index 60f9272..d0ee784 100644
> >>> --- a/drivers/usb/gadget/composite.c
> >>> +++ b/drivers/usb/gadget/composite.c
> >>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver
> >>> composite_driver = { */
> >>> int usb_composite_register(struct usb_composite_driver *driver)
> >>> {
> >>> + int res;
> >>> +
> >>> if (!driver || !driver->dev || !driver->bind || composite)
> >>> return -EINVAL;
> >>>
> >>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct
> >>> usb_composite_driver *driver) driver->name = "composite";
> >>> composite = driver;
> >>>
> >>> - return usb_gadget_register_driver(&composite_driver);
> >>> + res = usb_gadget_register_driver(&composite_driver);
> >>> + if (res != 0)
> >>> + composite = NULL;
> >>> +
> >>> + return res;
> >>> }
> >>>
> >>> /**
> >>> --
> >>> 2.7.0
> >>>
> >
> > bump
> >
>
> Looks fine. Lukasz, shall I pick this myself ?
>
> btw if this isn't applied in a week, please ping me and I will pick it
> nonetheless.
>
I will add this to my tree. And test it afterwards.
I will send new PR with some other patches.
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-29 10:11 ` Lukasz Majewski
@ 2016-02-29 11:40 ` Marek Vasut
2016-03-01 12:42 ` Lukasz Majewski
0 siblings, 1 reply; 8+ messages in thread
From: Marek Vasut @ 2016-02-29 11:40 UTC (permalink / raw)
To: u-boot
On 02/29/2016 11:11 AM, Lukasz Majewski wrote:
> Hi Marek,
>
>> On 02/26/2016 08:43 PM, Sam Protsenko wrote:
>>> On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
>>> <semen.protsenko@linaro.org> wrote:
>>>> + Praneeth Bajjuri
>>>> + Tom Rini
>>>> + Rob Herring
>>>>
>>>> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
>>>> <semen.protsenko@linaro.org> wrote:
>>>>> From: Sam Protsenko <semen.protsenko@linaro.org>
>>>>>
>>>>> In case when usb_composite_register() failed once (for whatever
>>>>> reason), it will fail further even if all conditions are correct.
>>>>> Example:
>>>>>
>>>>> => fastboot 2
>>>>> Invalid Controller Index
>>>>> couldn't find an available UDC
>>>>> g_dnl_register: failed!, error: -19
>>>>> exit not allowed from main input shell.
>>>>>
>>>>> => fastboot 0
>>>>> g_dnl_register: failed!, error: -22
>>>>> exit not allowed from main input shell.
>>>>>
>>>>> Despite that 0 is correct index for USB controller, "fastboot 0"
>>>>> command will fail, because "composite" structure wasn't cleared
>>>>> properly on previous fail (on "fastboot 2" command).
>>>>>
>>>>> This patch fixes that erroneous behavior, allowing us to use
>>>>> composite even after previous failure.
>>>>>
>>>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>>>>> ---
>>>>> drivers/usb/gadget/composite.c | 8 +++++++-
>>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/usb/gadget/composite.c
>>>>> b/drivers/usb/gadget/composite.c index 60f9272..d0ee784 100644
>>>>> --- a/drivers/usb/gadget/composite.c
>>>>> +++ b/drivers/usb/gadget/composite.c
>>>>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver
>>>>> composite_driver = { */
>>>>> int usb_composite_register(struct usb_composite_driver *driver)
>>>>> {
>>>>> + int res;
>>>>> +
>>>>> if (!driver || !driver->dev || !driver->bind || composite)
>>>>> return -EINVAL;
>>>>>
>>>>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct
>>>>> usb_composite_driver *driver) driver->name = "composite";
>>>>> composite = driver;
>>>>>
>>>>> - return usb_gadget_register_driver(&composite_driver);
>>>>> + res = usb_gadget_register_driver(&composite_driver);
>>>>> + if (res != 0)
>>>>> + composite = NULL;
>>>>> +
>>>>> + return res;
>>>>> }
>>>>>
>>>>> /**
>>>>> --
>>>>> 2.7.0
>>>>>
>>>
>>> bump
>>>
>>
>> Looks fine. Lukasz, shall I pick this myself ?
>>
>> btw if this isn't applied in a week, please ping me and I will pick it
>> nonetheless.
>>
>
> I will add this to my tree. And test it afterwards.
>
> I will send new PR with some other patches.
>
Roger, thanks!
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-02-29 11:40 ` Marek Vasut
@ 2016-03-01 12:42 ` Lukasz Majewski
2016-03-01 13:47 ` Marek Vasut
0 siblings, 1 reply; 8+ messages in thread
From: Lukasz Majewski @ 2016-03-01 12:42 UTC (permalink / raw)
To: u-boot
Hi Marek,
> On 02/29/2016 11:11 AM, Lukasz Majewski wrote:
> > Hi Marek,
> >
> >> On 02/26/2016 08:43 PM, Sam Protsenko wrote:
> >>> On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
> >>> <semen.protsenko@linaro.org> wrote:
> >>>> + Praneeth Bajjuri
> >>>> + Tom Rini
> >>>> + Rob Herring
> >>>>
> >>>> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
> >>>> <semen.protsenko@linaro.org> wrote:
> >>>>> From: Sam Protsenko <semen.protsenko@linaro.org>
> >>>>>
> >>>>> In case when usb_composite_register() failed once (for whatever
> >>>>> reason), it will fail further even if all conditions are
> >>>>> correct. Example:
> >>>>>
> >>>>> => fastboot 2
> >>>>> Invalid Controller Index
> >>>>> couldn't find an available UDC
> >>>>> g_dnl_register: failed!, error: -19
> >>>>> exit not allowed from main input shell.
> >>>>>
> >>>>> => fastboot 0
> >>>>> g_dnl_register: failed!, error: -22
> >>>>> exit not allowed from main input shell.
> >>>>>
> >>>>> Despite that 0 is correct index for USB controller, "fastboot 0"
> >>>>> command will fail, because "composite" structure wasn't cleared
> >>>>> properly on previous fail (on "fastboot 2" command).
> >>>>>
> >>>>> This patch fixes that erroneous behavior, allowing us to use
> >>>>> composite even after previous failure.
> >>>>>
> >>>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
> >>>>> ---
> >>>>> drivers/usb/gadget/composite.c | 8 +++++++-
> >>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/drivers/usb/gadget/composite.c
> >>>>> b/drivers/usb/gadget/composite.c index 60f9272..d0ee784 100644
> >>>>> --- a/drivers/usb/gadget/composite.c
> >>>>> +++ b/drivers/usb/gadget/composite.c
> >>>>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver
> >>>>> composite_driver = { */
> >>>>> int usb_composite_register(struct usb_composite_driver *driver)
> >>>>> {
> >>>>> + int res;
> >>>>> +
> >>>>> if (!driver || !driver->dev || !driver->bind ||
> >>>>> composite) return -EINVAL;
> >>>>>
> >>>>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct
> >>>>> usb_composite_driver *driver) driver->name = "composite";
> >>>>> composite = driver;
> >>>>>
> >>>>> - return usb_gadget_register_driver(&composite_driver);
> >>>>> + res = usb_gadget_register_driver(&composite_driver);
> >>>>> + if (res != 0)
> >>>>> + composite = NULL;
> >>>>> +
> >>>>> + return res;
> >>>>> }
> >>>>>
> >>>>> /**
> >>>>> --
> >>>>> 2.7.0
> >>>>>
> >>>
> >>> bump
> >>>
> >>
> >> Looks fine. Lukasz, shall I pick this myself ?
> >>
> >> btw if this isn't applied in a week, please ping me and I will
> >> pick it nonetheless.
> >>
> >
> > I will add this to my tree. And test it afterwards.
This patch seems correct - no regression found.
Tested-by: Lukasz Majewski "<l.majewski@samsung.com>"
Acked-by: Lukasz Majewski "<l.majewski@samsung.com>"
> >
> > I will send new PR with some other patches.
Patches which I thought that you didn't pull are already in u-boot-usb
tree, so there is no point to prepare PR for this single patch.
Hence, Marek, please apply it directly to -usb tree.
> >
>
> Roger, thanks!
>
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 8+ messages in thread
* [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register
2016-03-01 12:42 ` Lukasz Majewski
@ 2016-03-01 13:47 ` Marek Vasut
0 siblings, 0 replies; 8+ messages in thread
From: Marek Vasut @ 2016-03-01 13:47 UTC (permalink / raw)
To: u-boot
On 03/01/2016 01:42 PM, Lukasz Majewski wrote:
> Hi Marek,
>
>> On 02/29/2016 11:11 AM, Lukasz Majewski wrote:
>>> Hi Marek,
>>>
>>>> On 02/26/2016 08:43 PM, Sam Protsenko wrote:
>>>>> On Fri, Feb 19, 2016 at 9:34 PM, Sam Protsenko
>>>>> <semen.protsenko@linaro.org> wrote:
>>>>>> + Praneeth Bajjuri
>>>>>> + Tom Rini
>>>>>> + Rob Herring
>>>>>>
>>>>>> On Tue, Feb 16, 2016 at 7:59 PM, Semen Protsenko
>>>>>> <semen.protsenko@linaro.org> wrote:
>>>>>>> From: Sam Protsenko <semen.protsenko@linaro.org>
>>>>>>>
>>>>>>> In case when usb_composite_register() failed once (for whatever
>>>>>>> reason), it will fail further even if all conditions are
>>>>>>> correct. Example:
>>>>>>>
>>>>>>> => fastboot 2
>>>>>>> Invalid Controller Index
>>>>>>> couldn't find an available UDC
>>>>>>> g_dnl_register: failed!, error: -19
>>>>>>> exit not allowed from main input shell.
>>>>>>>
>>>>>>> => fastboot 0
>>>>>>> g_dnl_register: failed!, error: -22
>>>>>>> exit not allowed from main input shell.
>>>>>>>
>>>>>>> Despite that 0 is correct index for USB controller, "fastboot 0"
>>>>>>> command will fail, because "composite" structure wasn't cleared
>>>>>>> properly on previous fail (on "fastboot 2" command).
>>>>>>>
>>>>>>> This patch fixes that erroneous behavior, allowing us to use
>>>>>>> composite even after previous failure.
>>>>>>>
>>>>>>> Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
>>>>>>> ---
>>>>>>> drivers/usb/gadget/composite.c | 8 +++++++-
>>>>>>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/drivers/usb/gadget/composite.c
>>>>>>> b/drivers/usb/gadget/composite.c index 60f9272..d0ee784 100644
>>>>>>> --- a/drivers/usb/gadget/composite.c
>>>>>>> +++ b/drivers/usb/gadget/composite.c
>>>>>>> @@ -1077,6 +1077,8 @@ static struct usb_gadget_driver
>>>>>>> composite_driver = { */
>>>>>>> int usb_composite_register(struct usb_composite_driver *driver)
>>>>>>> {
>>>>>>> + int res;
>>>>>>> +
>>>>>>> if (!driver || !driver->dev || !driver->bind ||
>>>>>>> composite) return -EINVAL;
>>>>>>>
>>>>>>> @@ -1084,7 +1086,11 @@ int usb_composite_register(struct
>>>>>>> usb_composite_driver *driver) driver->name = "composite";
>>>>>>> composite = driver;
>>>>>>>
>>>>>>> - return usb_gadget_register_driver(&composite_driver);
>>>>>>> + res = usb_gadget_register_driver(&composite_driver);
>>>>>>> + if (res != 0)
>>>>>>> + composite = NULL;
>>>>>>> +
>>>>>>> + return res;
>>>>>>> }
>>>>>>>
>>>>>>> /**
>>>>>>> --
>>>>>>> 2.7.0
>>>>>>>
>>>>>
>>>>> bump
>>>>>
>>>>
>>>> Looks fine. Lukasz, shall I pick this myself ?
>>>>
>>>> btw if this isn't applied in a week, please ping me and I will
>>>> pick it nonetheless.
>>>>
>>>
>>> I will add this to my tree. And test it afterwards.
>
> This patch seems correct - no regression found.
>
> Tested-by: Lukasz Majewski "<l.majewski@samsung.com>"
> Acked-by: Lukasz Majewski "<l.majewski@samsung.com>"
>
>>>
>>> I will send new PR with some other patches.
>
> Patches which I thought that you didn't pull are already in u-boot-usb
> tree, so there is no point to prepare PR for this single patch.
>
> Hence, Marek, please apply it directly to -usb tree.
Applied, thanks!
--
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-03-01 13:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 17:59 [U-Boot] [PATCH] usb: gadget: composite: Correct recovery path for register Semen Protsenko
2016-02-19 19:34 ` Sam Protsenko
2016-02-26 19:43 ` Sam Protsenko
2016-02-26 19:52 ` Marek Vasut
2016-02-29 10:11 ` Lukasz Majewski
2016-02-29 11:40 ` Marek Vasut
2016-03-01 12:42 ` Lukasz Majewski
2016-03-01 13:47 ` Marek Vasut
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox