Commit 8cfc67f0 authored by Hema HK's avatar Hema HK Committed by Felipe Balbi

usb: otg: OMAP4430: Fixing the omap4430_phy_init function

omap4430_phy_init() function can be called with no device pointer,
to powerdown the PHY during board init when USB is disabled.
Fix the function accordingly.
Signed-off-by: default avatarHema HK <hemahk@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a6d28523
...@@ -50,13 +50,16 @@ int omap4430_phy_init(struct device *dev) ...@@ -50,13 +50,16 @@ int omap4430_phy_init(struct device *dev)
{ {
ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K); ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
if (!ctrl_base) { if (!ctrl_base) {
dev_err(dev, "control module ioremap failed\n"); pr_err("control module ioremap failed\n");
return -ENOMEM; return -ENOMEM;
} }
/* Power down the phy */ /* Power down the phy */
__raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF); __raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
if (!dev)
return 0;
phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
if (IS_ERR(phyclk)) { if (IS_ERR(phyclk)) {
dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n"); dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
iounmap(ctrl_base); iounmap(ctrl_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment