[PATCH] usb: usb3503: Propagate resume errors and unwind the clock

From: Zhu Jun

Date: Thu Nov 12 2026 - 02:40:51 EST


usb3503_resume() ignores failures when enabling the reference clock
and restoring the hub mode. It can report a successful resume while
the hub remains unusable. A failed mode switch also leaves the clock
reference enabled.

Stop if clock preparation fails. Return the mode-switch result and
disable the clock when restoring the mode fails.

Fixes: ecdc071d02a0 ("usb: usb3503: add PM functions")
Signed-off-by: Zhu Jun <zhujun2@xxxxxxxxxxxxxxxxxxxx>
---
drivers/usb/misc/usb3503.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/misc/usb3503.c b/drivers/usb/misc/usb3503.c
index 9f356b4bd84e..bcc6174b80d1 100644
--- a/drivers/usb/misc/usb3503.c
+++ b/drivers/usb/misc/usb3503.c
@@ -353,10 +353,17 @@ static int __maybe_unused usb3503_suspend(struct usb3503 *hub)

static int __maybe_unused usb3503_resume(struct usb3503 *hub)
{
- clk_prepare_enable(hub->clk);
- usb3503_switch_mode(hub, hub->mode);
+ int ret;

- return 0;
+ ret = clk_prepare_enable(hub->clk);
+ if (ret)
+ return ret;
+
+ ret = usb3503_switch_mode(hub, hub->mode);
+ if (ret)
+ clk_disable_unprepare(hub->clk);
+
+ return ret;
}

static int __maybe_unused usb3503_i2c_suspend(struct device *dev)
--
2.51.0