diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2020-07-22 20:07:46 +0300 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-07-24 16:45:15 +0300 |
commit | 1fa645b1c92795b090ea8de314b5cecc22dbfb03 (patch) | |
tree | 9abbc34c7997f06c101ed0db8bed0897f34613a7 /drivers/usb/gadget/udc/bdc | |
parent | 5fc453d7de3d0c345812453823a3a56783c5f82c (diff) | |
download | linux-1fa645b1c92795b090ea8de314b5cecc22dbfb03.tar.xz |
usb: bdc: Use devm_clk_get_optional()
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 <f.fainelli@gmail.com>
Signed-off-by: Al Cooper <alcooperx@gmail.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Diffstat (limited to 'drivers/usb/gadget/udc/bdc')
-rw-r--r-- | drivers/usb/gadget/udc/bdc/bdc_core.c | 8 |
1 files 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 0f1617e34f38..5ff36525044e 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -493,11 +493,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) { |