From: Al Cooper <alcooperx@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
Al Cooper <alcooperx@gmail.com>,
devicetree@vger.kernel.org, Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Sasi Kumar <sasi.kumar@broadcom.com>
Subject: [PATCH 7/7] usb: bdc: Use devm_clk_get_optional()
Date: Fri, 17 Jul 2020 11:23:07 -0400 [thread overview]
Message-ID: <20200717152307.36705-8-alcooperx@gmail.com> (raw)
In-Reply-To: <20200717152307.36705-1-alcooperx@gmail.com>
From: Florian Fainelli <florian.fainelli@broadcom.com>
The BDC clock is optional and we may get an -EPROBE_DEFER error code
which would not be propagated correctly, fix this by using
devm_clk_get_optional().
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index ac989adefe9d..5d8bd9129365 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -497,11 +497,9 @@ static int bdc_probe(struct platform_device *pdev)
dev_dbg(dev, "%s()\n", __func__);
- clk = devm_clk_get(dev, "sw_usbd");
- if (IS_ERR(clk)) {
- dev_info(dev, "Clock not found in Device Tree\n");
- clk = NULL;
- }
+ clk = devm_clk_get_optional(dev, "sw_usbd");
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
ret = clk_prepare_enable(clk);
if (ret) {
--
2.17.1
next prev parent reply other threads:[~2020-07-17 15:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-17 15:23 [PATCH 0/7] usb: bdc: Updates and fixes to the USB BDC driver Al Cooper
2020-07-17 15:23 ` [PATCH 1/7] dt-bindings: usb: bdc: Update compatible strings Al Cooper
2020-07-17 15:23 ` [PATCH 2/7] usb: bdc: Add compatible string for new style USB DT nodes Al Cooper
2020-07-17 16:55 ` Florian Fainelli
2020-07-17 15:23 ` [PATCH 3/7] bdc: Fix bug causing crash after multiple disconnects Al Cooper
2020-07-17 16:56 ` Florian Fainelli
2020-07-17 15:23 ` [PATCH 4/7] usb: bdc: Adb shows offline after resuming from S2 Al Cooper
2020-07-17 15:23 ` [PATCH 5/7] usb: bdc: driver runs out of buffer descriptors on large ADB transfers Al Cooper
2020-07-17 16:58 ` Florian Fainelli
2020-07-17 15:23 ` [PATCH 6/7] usb: bdc: Halt controller on suspend Al Cooper
2020-07-17 15:23 ` Al Cooper [this message]
2020-07-17 16:57 ` [PATCH 7/7] usb: bdc: Use devm_clk_get_optional() Florian Fainelli
2020-07-21 9:33 ` [PATCH 0/7] usb: bdc: Updates and fixes to the USB BDC driver Felipe Balbi
2020-07-21 13:45 ` Alan Cooper
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=20200717152307.36705-8-alcooperx@gmail.com \
--to=alcooperx@gmail.com \
--cc=balbi@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sasi.kumar@broadcom.com \
/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;
as well as URLs for NNTP newsgroup(s).