All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()'
@ 2021-11-07 16:25 ` Christophe JAILLET
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-11-07 16:25 UTC (permalink / raw)
  To: balbi, gregkh, michal.simek, lee.jones, jiapeng.chong,
	abaci-bugfix, shubhrajyoti.datta
  Cc: linux-usb, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

A successful 'clk_prepare_enable()' call should be balanced by a
corresponding 'clk_disable_unprepare()' call in the error handling path
of the probe, as already done in the remove function.

Fixes: 24749229211c ("usb: gadget: udc-xilinx: Add clock support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/usb/gadget/udc/udc-xilinx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index f5ca670776a3..857159dd5ae0 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev)
 
 	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
 	if (ret)
-		goto fail;
+		goto err_disable_unprepare_clk;
 
 	udc->dev = &udc->gadget.dev;
 
@@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev)
 		 udc->dma_enabled ? "with DMA" : "without DMA");
 
 	return 0;
+
+err_disable_unprepare_clk:
+	clk_disable_unprepare(udc->clk);
 fail:
 	dev_err(&pdev->dev, "probe failed, %d\n", ret);
 	return ret;
-- 
2.30.2


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

* [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()'
@ 2021-11-07 16:25 ` Christophe JAILLET
  0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-11-07 16:25 UTC (permalink / raw)
  To: balbi, gregkh, michal.simek, lee.jones, jiapeng.chong,
	abaci-bugfix, shubhrajyoti.datta
  Cc: linux-usb, linux-arm-kernel, linux-kernel, kernel-janitors,
	Christophe JAILLET

A successful 'clk_prepare_enable()' call should be balanced by a
corresponding 'clk_disable_unprepare()' call in the error handling path
of the probe, as already done in the remove function.

Fixes: 24749229211c ("usb: gadget: udc-xilinx: Add clock support")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/usb/gadget/udc/udc-xilinx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
index f5ca670776a3..857159dd5ae0 100644
--- a/drivers/usb/gadget/udc/udc-xilinx.c
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev)
 
 	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
 	if (ret)
-		goto fail;
+		goto err_disable_unprepare_clk;
 
 	udc->dev = &udc->gadget.dev;
 
@@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev)
 		 udc->dma_enabled ? "with DMA" : "without DMA");
 
 	return 0;
+
+err_disable_unprepare_clk:
+	clk_disable_unprepare(udc->clk);
 fail:
 	dev_err(&pdev->dev, "probe failed, %d\n", ret);
 	return ret;
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()'
  2021-11-07 16:25 ` Christophe JAILLET
@ 2021-11-08  4:49   ` Shubhrajyoti Datta
  -1 siblings, 0 replies; 4+ messages in thread
From: Shubhrajyoti Datta @ 2021-11-08  4:49 UTC (permalink / raw)
  To: Christophe JAILLET, balbi, gregkh, Michal Simek, lee.jones,
	jiapeng.chong, abaci-bugfix
  Cc: linux-usb, linux-arm-kernel, linux-kernel, kernel-janitors



> -----Original Message-----
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Sent: Sunday, November 7, 2021 9:56 PM
> To: balbi@kernel.org; gregkh@linuxfoundation.org; Michal Simek
> <michals@xilinx.com>; lee.jones@linaro.org; jiapeng.chong@linux.alibaba.com;
> abaci-bugfix@linux.alibaba.com; Shubhrajyoti Datta <shubhraj@xilinx.com>
> Cc: linux-usb@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> <christophe.jaillet@wanadoo.fr>
> Subject: [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in
> 'xudc_probe()'
> 
> A successful 'clk_prepare_enable()' call should be balanced by a corresponding
> 'clk_disable_unprepare()' call in the error handling path of the probe, as already
> done in the remove function.
> 
Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com>

> Fixes: 24749229211c ("usb: gadget: udc-xilinx: Add clock support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-
> xilinx.c
> index f5ca670776a3..857159dd5ae0 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev)
> 
>  	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
>  	if (ret)
> -		goto fail;
> +		goto err_disable_unprepare_clk;
> 
>  	udc->dev = &udc->gadget.dev;
> 
> @@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev)
>  		 udc->dma_enabled ? "with DMA" : "without DMA");
> 
>  	return 0;
> +
> +err_disable_unprepare_clk:
> +	clk_disable_unprepare(udc->clk);
>  fail:
>  	dev_err(&pdev->dev, "probe failed, %d\n", ret);
>  	return ret;
> --
> 2.30.2


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

* RE: [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()'
@ 2021-11-08  4:49   ` Shubhrajyoti Datta
  0 siblings, 0 replies; 4+ messages in thread
From: Shubhrajyoti Datta @ 2021-11-08  4:49 UTC (permalink / raw)
  To: Christophe JAILLET, balbi, gregkh, Michal Simek, lee.jones,
	jiapeng.chong, abaci-bugfix
  Cc: linux-usb, linux-arm-kernel, linux-kernel, kernel-janitors



> -----Original Message-----
> From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Sent: Sunday, November 7, 2021 9:56 PM
> To: balbi@kernel.org; gregkh@linuxfoundation.org; Michal Simek
> <michals@xilinx.com>; lee.jones@linaro.org; jiapeng.chong@linux.alibaba.com;
> abaci-bugfix@linux.alibaba.com; Shubhrajyoti Datta <shubhraj@xilinx.com>
> Cc: linux-usb@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> kernel@vger.kernel.org; kernel-janitors@vger.kernel.org; Christophe JAILLET
> <christophe.jaillet@wanadoo.fr>
> Subject: [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in
> 'xudc_probe()'
> 
> A successful 'clk_prepare_enable()' call should be balanced by a corresponding
> 'clk_disable_unprepare()' call in the error handling path of the probe, as already
> done in the remove function.
> 
Reviewed-by: Shubhrajyoti Datta <shubhraj@xilinx.com>

> Fixes: 24749229211c ("usb: gadget: udc-xilinx: Add clock support")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-
> xilinx.c
> index f5ca670776a3..857159dd5ae0 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -2136,7 +2136,7 @@ static int xudc_probe(struct platform_device *pdev)
> 
>  	ret = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
>  	if (ret)
> -		goto fail;
> +		goto err_disable_unprepare_clk;
> 
>  	udc->dev = &udc->gadget.dev;
> 
> @@ -2155,6 +2155,9 @@ static int xudc_probe(struct platform_device *pdev)
>  		 udc->dma_enabled ? "with DMA" : "without DMA");
> 
>  	return 0;
> +
> +err_disable_unprepare_clk:
> +	clk_disable_unprepare(udc->clk);
>  fail:
>  	dev_err(&pdev->dev, "probe failed, %d\n", ret);
>  	return ret;
> --
> 2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-11-08  4:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-07 16:25 [PATCH] usb: gadget: udc-xilinx: Fix an error handling path in 'xudc_probe()' Christophe JAILLET
2021-11-07 16:25 ` Christophe JAILLET
2021-11-08  4:49 ` Shubhrajyoti Datta
2021-11-08  4:49   ` Shubhrajyoti Datta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.