From: Florian Fainelli Date: Wed, 22 Jul 2020 17:07:46 +0000 (-0400) Subject: usb: bdc: Use devm_clk_get_optional() X-Git-Tag: v5.9-rc1~142^2~35^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fa645b1c92795b090ea8de314b5cecc22dbfb03;p=thirdparty%2Flinux.git 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 Signed-off-by: Al Cooper Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index 0f1617e34f38a..5ff36525044ef 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) {