From: Fabio Estevam <festevam@gmail.com>
To: gregkh@linuxfoundation.org
Cc: mka@chromium.org, frieder.schrempf@kontron.de,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Fabio Estevam <festevam@denx.de>
Subject: [PATCH] usb: misc: onboard_usb_hub: Disable the USB hub clock on failure
Date: Mon, 8 Apr 2024 12:17:00 -0300 [thread overview]
Message-ID: <20240408151700.1761009-1-festevam@gmail.com> (raw)
From: Fabio Estevam <festevam@denx.de>
In case regulator_bulk_enable() fails, the previously enabled USB hub
clock should be disabled.
Fix it accordingly.
Fixes: 65e62b8a955a ("usb: misc: onboard_usb_hub: Add support for clock input")
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
drivers/usb/misc/onboard_usb_dev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
index 648ea933bdad..f2bcc1a8b95f 100644
--- a/drivers/usb/misc/onboard_usb_dev.c
+++ b/drivers/usb/misc/onboard_usb_dev.c
@@ -93,7 +93,7 @@ static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
if (err) {
dev_err(onboard_dev->dev, "failed to enable supplies: %pe\n",
ERR_PTR(err));
- return err;
+ goto disable_clk;
}
fsleep(onboard_dev->pdata->reset_us);
@@ -102,6 +102,10 @@ static int onboard_dev_power_on(struct onboard_dev *onboard_dev)
onboard_dev->is_powered_on = true;
return 0;
+
+disable_clk:
+ clk_disable_unprepare(onboard_dev->clk);
+ return err;
}
static int onboard_dev_power_off(struct onboard_dev *onboard_dev)
--
2.34.1
next reply other threads:[~2024-04-08 15:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 15:17 Fabio Estevam [this message]
2024-04-08 15:36 ` [PATCH] usb: misc: onboard_usb_hub: Disable the USB hub clock on failure Frieder Schrempf
2024-04-08 17:12 ` Matthias Kaehlcke
2024-04-09 15:29 ` Greg KH
2024-04-09 16:42 ` Matthias Kaehlcke
2024-04-11 12:18 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240408151700.1761009-1-festevam@gmail.com \
--to=festevam@gmail.com \
--cc=festevam@denx.de \
--cc=frieder.schrempf@kontron.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mka@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox