From: Chunfeng Yun Date: Tue, 7 Feb 2017 06:13:32 +0000 (+0800) Subject: usb: mtu3: make the reference clock optional X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca12cb7cb06d08e54e3ac23b1ebe5ed81d68dbf0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: mtu3: make the reference clock optional Make the reference clock optional for DTS backward compatibility and ignore the error if it does not exist. Signed-off-by: Chunfeng Yun Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 19a345d6687d..c3125da66bab 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -225,10 +225,17 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) return PTR_ERR(ssusb->sys_clk); } + /* + * reference clock is usually a "fixed-clock", make it optional + * for backward compatibility and ignore the error if it does + * not exist. + */ ssusb->ref_clk = devm_clk_get(dev, "ref_ck"); if (IS_ERR(ssusb->ref_clk)) { - dev_err(dev, "failed to get ref clock\n"); - return PTR_ERR(ssusb->ref_clk); + if (PTR_ERR(ssusb->ref_clk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + ssusb->ref_clk = NULL; } ssusb->num_phys = of_count_phandle_with_args(node,