mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'
@ 2021-03-06 14:21 Christophe JAILLET
  2021-03-06 16:16 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe JAILLET @ 2021-03-06 14:21 UTC (permalink / raw)
  To: balbi, gregkh, krzk, nathan, gustavoars, arnd, ben-linux
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	kernel-janitors, Christophe JAILLET

Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error
handling path of the probe function, as already done in the remove
function.

Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
v2: Fix a stupid error in the hash in Fixes:
---
 drivers/usb/gadget/udc/s3c2410_udc.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index 3fc436286bad..146250e93412 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1750,7 +1750,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 	udc_clock = clk_get(NULL, "usb-device");
 	if (IS_ERR(udc_clock)) {
 		dev_err(dev, "failed to get udc clock source\n");
-		return PTR_ERR(udc_clock);
+		retval = PTR_ERR(udc_clock);
+		goto err_usb_bus_clk;
 	}
 
 	clk_prepare_enable(udc_clock);
@@ -1773,7 +1774,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 	base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (!base_addr) {
 		retval = -ENOMEM;
-		goto err;
+		goto err_udc_clk;
 	}
 
 	the_controller = udc;
@@ -1791,7 +1792,7 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 	if (retval != 0) {
 		dev_err(dev, "cannot get irq %i, err %d\n", irq_usbd, retval);
 		retval = -EBUSY;
-		goto err;
+		goto err_udc_clk;
 	}
 
 	dev_dbg(dev, "got irq %i\n", irq_usbd);
@@ -1862,7 +1863,14 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 		gpio_free(udc_info->vbus_pin);
 err_int:
 	free_irq(irq_usbd, udc);
-err:
+err_udc_clk:
+	clk_disable_unprepare(udc_clock);
+	clk_put(udc_clock);
+	udc_clock = NULL;
+err_usb_bus_clk:
+	clk_disable_unprepare(usb_bus_clock);
+	clk_put(usb_bus_clock);
+	usb_bus_clock = NULL;
 
 	return retval;
 }
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'
  2021-03-06 14:21 [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()' Christophe JAILLET
@ 2021-03-06 16:16 ` Krzysztof Kozlowski
  2021-03-06 17:22   ` Christophe JAILLET
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-06 16:16 UTC (permalink / raw)
  To: Christophe JAILLET, balbi, gregkh, nathan, gustavoars, arnd, ben-linux
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	kernel-janitors

On 06/03/2021 15:21, Christophe JAILLET wrote:
> Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error
> handling path of the probe function, as already done in the remove
> function.
> 
> Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> v2: Fix a stupid error in the hash in Fixes:
> ---
>  drivers/usb/gadget/udc/s3c2410_udc.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 

Do not ignore received tags but add them before sending a new version of patch.
https://lore.kernel.org/linux-samsung-soc/36ef897b-aedc-fcc3-89c8-c602d9733a9b@canonical.com/T/#t

Also somehow your 2nd patch is not in-reply to first one. Don't change
the settings of sending patches. git format-patch and
git send-email default settings are correct. Look here:
https://lore.kernel.org/linux-samsung-soc/
Only your patches are not threaded.

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'
  2021-03-06 16:16 ` Krzysztof Kozlowski
@ 2021-03-06 17:22   ` Christophe JAILLET
  2021-03-06 18:17     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe JAILLET @ 2021-03-06 17:22 UTC (permalink / raw)
  To: Krzysztof Kozlowski, balbi, gregkh, nathan, gustavoars, arnd, ben-linux
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	kernel-janitors

Le 06/03/2021 à 17:16, Krzysztof Kozlowski a écrit :
> On 06/03/2021 15:21, Christophe JAILLET wrote:
>> Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error
>> handling path of the probe function, as already done in the remove
>> function.
>>
>> Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>> v2: Fix a stupid error in the hash in Fixes:
>> ---
>>   drivers/usb/gadget/udc/s3c2410_udc.c | 16 ++++++++++++----
>>   1 file changed, 12 insertions(+), 4 deletions(-)
>>
> 
> Do not ignore received tags but add them before sending a new version of patch.
> https://lore.kernel.org/linux-samsung-soc/36ef897b-aedc-fcc3-89c8-c602d9733a9b@canonical.com/T/#t
> 
> Also somehow your 2nd patch is not in-reply to first one. Don't change
> the settings of sending patches. git format-patch and
> git send-email default settings are correct. Look here:
> https://lore.kernel.org/linux-samsung-soc/
> Only your patches are not threaded.
> 
> Best regards,
> Krzysztof
> 
Hi,

sorry for missing the typo in the first patch.

For your other comments above, however, I use standard settings only.
My patches are generated by commands like:
    git format-patch -2

I use cover letter only if it looks useful. In such a case, I use:
    git format-patch --thread --cover-letter -2

I've never seen that threading series was the rule and/or that cover 
letters were a must have. If I'm wrong, sorry, I was not aware of that.

I'll also add the "Reviewed-by:" tag.


Thx for the review and explanations.

CJ

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()'
  2021-03-06 17:22   ` Christophe JAILLET
@ 2021-03-06 18:17     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-06 18:17 UTC (permalink / raw)
  To: Christophe JAILLET, balbi, gregkh, nathan, gustavoars, arnd, ben-linux
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	kernel-janitors

On 06/03/2021 18:22, Christophe JAILLET wrote:
> Le 06/03/2021 à 17:16, Krzysztof Kozlowski a écrit :
>> On 06/03/2021 15:21, Christophe JAILLET wrote:
>>> Some 'clk_prepare_enable()' and 'clk_get()' must be undone in the error
>>> handling path of the probe function, as already done in the remove
>>> function.
>>>
>>> Fixes: 3fc154b6b813 ("USB Gadget driver for Samsung s3c2410 ARM SoC")
>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>> ---
>>> v2: Fix a stupid error in the hash in Fixes:
>>> ---
>>>   drivers/usb/gadget/udc/s3c2410_udc.c | 16 ++++++++++++----
>>>   1 file changed, 12 insertions(+), 4 deletions(-)
>>>
>>
>> Do not ignore received tags but add them before sending a new version of patch.
>> https://lore.kernel.org/linux-samsung-soc/36ef897b-aedc-fcc3-89c8-c602d9733a9b@canonical.com/T/#t
>>
>> Also somehow your 2nd patch is not in-reply to first one. Don't change
>> the settings of sending patches. git format-patch and
>> git send-email default settings are correct. Look here:
>> https://lore.kernel.org/linux-samsung-soc/
>> Only your patches are not threaded.
>>
>> Best regards,
>> Krzysztof
>>
> Hi,
> 
> sorry for missing the typo in the first patch.
> 
> For your other comments above, however, I use standard settings only.
> My patches are generated by commands like:
>     git format-patch -2
> 
> I use cover letter only if it looks useful. In such a case, I use:
>     git format-patch --thread --cover-letter -2
> 
> I've never seen that threading series was the rule and/or that cover 
> letters were a must have. If I'm wrong, sorry, I was not aware of that.

The cover letter is not needed. The threading was missing which is a
default so you had to configure it to that.


Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-06 18:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06 14:21 [PATCH 2/2 v2] usb: gadget: s3c: Fix the error handling path in 's3c2410_udc_probe()' Christophe JAILLET
2021-03-06 16:16 ` Krzysztof Kozlowski
2021-03-06 17:22   ` Christophe JAILLET
2021-03-06 18:17     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®