Skip to content

Commit 34b990e

Browse files
Fabio Estevamgregkh
authored andcommitted
usb: misc: onboard_usb_hub: Disable the USB hub clock on failure
In case regulator_bulk_enable() fails, the previously enabled USB hub clock should be disabled. Fix it accordingly. Fixes: 65e62b8 ("usb: misc: onboard_usb_hub: Add support for clock input") Cc: stable <stable@kernel.org> Signed-off-by: Fabio Estevam <festevam@denx.de> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Acked-by: Matthias Kaehlcke <mka@chromium.org> Link: https://lore.kernel.org/r/20240409162910.2061640-1-festevam@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent eed04fa commit 34b990e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/usb/misc/onboard_usb_hub.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static int onboard_hub_power_on(struct onboard_hub *hub)
7878
err = regulator_bulk_enable(hub->pdata->num_supplies, hub->supplies);
7979
if (err) {
8080
dev_err(hub->dev, "failed to enable supplies: %pe\n", ERR_PTR(err));
81-
return err;
81+
goto disable_clk;
8282
}
8383

8484
fsleep(hub->pdata->reset_us);
@@ -87,6 +87,10 @@ static int onboard_hub_power_on(struct onboard_hub *hub)
8787
hub->is_powered_on = true;
8888

8989
return 0;
90+
91+
disable_clk:
92+
clk_disable_unprepare(hub->clk);
93+
return err;
9094
}
9195

9296
static int onboard_hub_power_off(struct onboard_hub *hub)

0 commit comments

Comments
 (0)