diff options
author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2017-02-07 09:13:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-02-08 09:44:52 +0300 |
commit | f3c4c73704b2e1a66c74504721e0af403174fdd3 (patch) | |
tree | 9eee969b41de846df2fb80dee42241e0b8aaaf27 /drivers/usb/host | |
parent | ca12cb7cb06d08e54e3ac23b1ebe5ed81d68dbf0 (diff) | |
download | linux-f3c4c73704b2e1a66c74504721e0af403174fdd3.tar.xz |
usb: xhci-mtk: 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 <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-mtk.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index b30806a0d37a..9066ec9e0c2e 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -559,10 +559,17 @@ static int xhci_mtk_probe(struct platform_device *pdev) return PTR_ERR(mtk->sys_clk); } + /* + * reference clock is usually a "fixed-clock", make it optional + * for backward compatibility and ignore the error if it does + * not exist. + */ mtk->ref_clk = devm_clk_get(dev, "ref_ck"); if (IS_ERR(mtk->ref_clk)) { - dev_err(dev, "fail to get ref_ck\n"); - return PTR_ERR(mtk->ref_clk); + if (PTR_ERR(mtk->ref_clk) == -EPROBE_DEFER) + return -EPROBE_DEFER; + + mtk->ref_clk = NULL; } mtk->lpm_support = of_property_read_bool(node, "usb3-lpm-capable"); |