linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
To: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
Subject: [PATCH 1/2] usb: otg: OMAP4430: Fix omap4430_phy_init function
Date: Thu, 24 Mar 2011 16:36:04 +0530	[thread overview]
Message-ID: <1300964764-6794-1-git-send-email-hemahk@ti.com> (raw)

omap4430_phy_init() function can be called with no device pointer
to powerdown the UTMI PHY during board init when USB is disabled.
Fix the function accordingly.

Signed-off-by: Hema HK <hemahk-l0cyMroinI0@public.gmane.org>
---
 arch/arm/mach-omap2/omap_phy_internal.c |   44 ++++++++++++++++--------------
 1 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_phy_internal.c b/arch/arm/mach-omap2/omap_phy_internal.c
index e2e605f..a959e2f 100644
--- a/arch/arm/mach-omap2/omap_phy_internal.c
+++ b/arch/arm/mach-omap2/omap_phy_internal.c
@@ -50,34 +50,36 @@ int omap4430_phy_init(struct device *dev)
 {
 	ctrl_base = ioremap(OMAP443X_SCM_BASE, SZ_1K);
 	if (!ctrl_base) {
-		dev_err(dev, "control module ioremap failed\n");
+		printk(KERN_ERR "control module ioremap failed\n");
 		return -ENOMEM;
 	}
 	/* Power down the phy */
 	__raw_writel(PHY_PD, ctrl_base + CONTROL_DEV_CONF);
-	phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
 
-	if (IS_ERR(phyclk)) {
-		dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
-		iounmap(ctrl_base);
-		return PTR_ERR(phyclk);
-	}
+	if (dev) {
+		phyclk = clk_get(dev, "ocp2scp_usb_phy_ick");
+		if (IS_ERR(phyclk)) {
+			dev_err(dev, "cannot clk_get ocp2scp_usb_phy_ick\n");
+			iounmap(ctrl_base);
+			return PTR_ERR(phyclk);
+		}
 
-	clk48m = clk_get(dev, "ocp2scp_usb_phy_phy_48m");
-	if (IS_ERR(clk48m)) {
-		dev_err(dev, "cannot clk_get ocp2scp_usb_phy_phy_48m\n");
-		clk_put(phyclk);
-		iounmap(ctrl_base);
-		return PTR_ERR(clk48m);
-	}
+		clk48m = clk_get(dev, "ocp2scp_usb_phy_phy_48m");
+		if (IS_ERR(clk48m)) {
+			dev_err(dev, "cannot clk_get ocp2scp_usb_phy_phy_48m\n");
+			clk_put(phyclk);
+			iounmap(ctrl_base);
+			return PTR_ERR(clk48m);
+		}
 
-	clk32k = clk_get(dev, "usb_phy_cm_clk32k");
-	if (IS_ERR(clk32k)) {
-		dev_err(dev, "cannot clk_get usb_phy_cm_clk32k\n");
-		clk_put(phyclk);
-		clk_put(clk48m);
-		iounmap(ctrl_base);
-		return PTR_ERR(clk32k);
+		clk32k = clk_get(dev, "usb_phy_cm_clk32k");
+		if (IS_ERR(clk32k)) {
+			dev_err(dev, "cannot clk_get usb_phy_cm_clk32k\n");
+			clk_put(phyclk);
+			clk_put(clk48m);
+			iounmap(ctrl_base);
+			return PTR_ERR(clk32k);
+		}
 	}
 	return 0;
 }
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2011-03-24 11:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 11:06 Hema HK [this message]
2011-03-24 11:08 ` [PATCH 1/2] usb: otg: OMAP4430: Fix omap4430_phy_init function Felipe Balbi
     [not found]   ` <20110324110824.GH14602-UiBtZHVXSwEVvW8u9ZQWYwjfymiNCTlR@public.gmane.org>
2011-03-24 11:15     ` Hema Kalliguddi
2011-03-24 13:17 ` Sergei Shtylyov
     [not found]   ` <4D8B4482.4040506-hkdhdckH98+B+jHODAdFcQ@public.gmane.org>
2011-03-25  7:18     ` Hema Kalliguddi
     [not found] ` <1300964764-6794-1-git-send-email-hemahk-l0cyMroinI0@public.gmane.org>
2011-03-28 21:19   ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300964764-6794-1-git-send-email-hemahk@ti.com \
    --to=hemahk-l0cymroini0@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).