Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: pxa27x_udc: check return value of clk_enable
@ 2026-03-01 16:23 Zhaoyang Yu
  2026-03-01 16:37 ` Sergey Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Zhaoyang Yu @ 2026-03-01 16:23 UTC (permalink / raw)
  To: daniel, haojian.zhuang, robert.jarzmik, gregkh
  Cc: linux-arm-kernel, linux-usb, linux-kernel, Zhaoyang Yu

clk_enable() may fail according to the API contract.
Previously, udc_enable() ignored its return value.
This patch checks the return value and logs an error
without continuing initialization if clk_enable fails.

Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index 897f53601b5b..69fcecaf6061 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -1696,7 +1696,13 @@ static void udc_enable(struct pxa_udc *udc)
 	if (udc->enabled)
 		return;
 
-	clk_enable(udc->clk);
+	int ret;
+
+	ret = clk_enable(udc->clk);
+	if (ret) {
+		dev_err(udc->dev, "clk_enable failed: %d\n", ret);
+		return;
+	}
 	udc_writel(udc, UDCICR0, 0);
 	udc_writel(udc, UDCICR1, 0);
 	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] USB: pxa27x_udc: check return value of clk_enable
@ 2026-03-01 16:55 Zhaoyang Yu
  2026-03-11 12:49 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Zhaoyang Yu @ 2026-03-01 16:55 UTC (permalink / raw)
  To: sergei.shtylyov, daniel, haojian.zhuang, robert.jarzmik, gregkh
  Cc: linux-arm-kernel, linux-usb, linux-kernel, Zhaoyang Yu

clk_enable() may fail according to the API contract.
Previously, udc_enable() ignored its return value.
This patch checks the return value and logs an error
without continuing initialization if clk_enable fails.

Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
---
 drivers/usb/gadget/udc/pxa27x_udc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/pxa27x_udc.c b/drivers/usb/gadget/udc/pxa27x_udc.c
index 897f53601b5b..006d6d0a5f9a 100644
--- a/drivers/usb/gadget/udc/pxa27x_udc.c
+++ b/drivers/usb/gadget/udc/pxa27x_udc.c
@@ -1693,10 +1693,16 @@ static void udc_init_data(struct pxa_udc *dev)
  */
 static void udc_enable(struct pxa_udc *udc)
 {
+	int ret;
+
 	if (udc->enabled)
 		return;
 
-	clk_enable(udc->clk);
+	ret = clk_enable(udc->clk);
+	if (ret) {
+		dev_err(udc->dev, "clk_enable failed: %d\n", ret);
+		return;
+	}
 	udc_writel(udc, UDCICR0, 0);
 	udc_writel(udc, UDCICR1, 0);
 	udc_clear_mask_UDCCR(udc, UDCCR_UDE);
-- 
2.34.1



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

end of thread, other threads:[~2026-03-11 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01 16:23 [PATCH] USB: pxa27x_udc: check return value of clk_enable Zhaoyang Yu
2026-03-01 16:37 ` Sergey Shtylyov
  -- strict thread matches above, loose matches on Subject: below --
2026-03-01 16:55 Zhaoyang Yu
2026-03-11 12:49 ` Greg KH

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