Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca12cb7c authored by Chunfeng Yun's avatar Chunfeng Yun Committed by Greg Kroah-Hartman
Browse files

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: default avatarChunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cb6efc7b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -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,