From patchwork Thu Mar 24 11:06:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kalliguddi, Hema" X-Patchwork-Id: 658491 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2OB6Mpf017070 for ; Thu, 24 Mar 2011 11:06:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753258Ab1CXLGS (ORCPT ); Thu, 24 Mar 2011 07:06:18 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:38091 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752644Ab1CXLGS (ORCPT ); Thu, 24 Mar 2011 07:06:18 -0400 Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2OB6EwY018045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Mar 2011 06:06:16 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p2OB6CQ2000459; Thu, 24 Mar 2011 16:36:13 +0530 (IST) From: Hema HK To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Hema HK Subject: [PATCH 1/2] usb: otg: OMAP4430: Fix omap4430_phy_init function Date: Thu, 24 Mar 2011 16:36:04 +0530 Message-Id: <1300964764-6794-1-git-send-email-hemahk@ti.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 24 Mar 2011 11:06:23 +0000 (UTC) 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; }