diff mbox

[v1,2/3] usb: phy: msm: Make phy_reset clk and reset line optional.

Message ID 1404149389-11928-1-git-send-email-srinivas.kandagatla@linaro.org
State Accepted
Commit e44f1f4c04f273469b2a396f5f0fe03b5bb373d2
Headers show

Commit Message

Srinivas Kandagatla June 30, 2014, 5:29 p.m. UTC
This patch makes the phy reset clk and reset line optional as this clk
is not available on boards like IFC6410 with APQ8064.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/usb/phy/phy-msm-usb.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c
index ced34f3..3bb559d 100644
--- a/drivers/usb/phy/phy-msm-usb.c
+++ b/drivers/usb/phy/phy-msm-usb.c
@@ -279,11 +279,11 @@  static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert)
 
 static int msm_otg_phy_clk_reset(struct msm_otg *motg)
 {
-	int ret;
+	int ret = 0;
 
-	if (motg->pdata->phy_clk_reset)
+	if (motg->pdata->phy_clk_reset && motg->phy_reset_clk)
 		ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk);
-	else
+	else if (motg->phy_rst)
 		ret = reset_control_reset(motg->phy_rst);
 
 	if (ret)
@@ -1464,7 +1464,7 @@  static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg)
 
 	motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy");
 	if (IS_ERR(motg->phy_rst))
-		return PTR_ERR(motg->phy_rst);
+		motg->phy_rst = NULL;
 
 	pdata->mode = of_usb_get_dr_mode(node);
 	if (pdata->mode == USB_DR_MODE_UNKNOWN)
@@ -1556,7 +1556,7 @@  static int msm_otg_probe(struct platform_device *pdev)
 					   np ? "phy" : "usb_phy_clk");
 	if (IS_ERR(motg->phy_reset_clk)) {
 		dev_err(&pdev->dev, "failed to get usb_phy_clk\n");
-		return PTR_ERR(motg->phy_reset_clk);
+		motg->phy_reset_clk = NULL;
 	}
 
 	motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");