From patchwork Mon Jul 8 11:14:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 2824808 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 44BD6C0AB2 for ; Mon, 8 Jul 2013 11:17:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 233602012F for ; Mon, 8 Jul 2013 11:16:59 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FDF720124 for ; Mon, 8 Jul 2013 11:16:57 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uw9Pl-00075r-Ax; Mon, 08 Jul 2013 11:15:29 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uw9PX-00061C-Tn; Mon, 08 Jul 2013 11:15:15 +0000 Received: from comal.ext.ti.com ([198.47.26.152]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Uw9PK-0005yS-MJ for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2013 11:15:04 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r68BEZYm007611; Mon, 8 Jul 2013 06:14:35 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r68BEZaJ018627; Mon, 8 Jul 2013 06:14:35 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Mon, 8 Jul 2013 06:14:35 -0500 Received: from a0393678ub.apr.dhcp.ti.com (a0393678ub.apr.dhcp.ti.com [172.24.145.11]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r68BEK52006518; Mon, 8 Jul 2013 06:14:32 -0500 From: Kishon Vijay Abraham I To: , , Subject: [PATCH v2 3/4] usb: musb: omap: use the new API to get PHY reference by label Date: Mon, 8 Jul 2013 16:44:16 +0530 Message-ID: <1373282057-20181-4-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1373282057-20181-1-git-send-email-kishon@ti.com> References: <1373282057-20181-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130708_071502_952679_F3513022 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -7.2 (-------) Cc: linux@arm.linux.org.uk, eballetbo@gmail.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, javier@dowhile0.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After the devices are created using PLATFORM_DEVID_AUTO, devm_usb_get_phy_dev and usb_get_phy_dev can't be used reliably as it relies on the device_names passed in usb_bind_phy. So used the new API devm_usb_get_phy_by_name to get the PHY reference. Signed-off-by: Kishon Vijay Abraham I Acked-by: Felipe Balbi Tested-by: Tomi Valkeinen --- drivers/usb/musb/musb_core.c | 1 + drivers/usb/musb/musb_core.h | 1 + drivers/usb/musb/omap2430.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 29a24ce..5eb6cd7 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1814,6 +1814,7 @@ musb_init_controller(struct device *dev, int nIrq, void __iomem *ctrl) musb->min_power = plat->min_power; musb->ops = plat->platform_ops; musb->port_mode = plat->mode; + musb->phy_name = plat->phy_name; /* The musb_platform_init() call: * - adjusts musb->mregs diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 7d341c3..1f0863b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -424,6 +424,7 @@ struct musb { unsigned double_buffer_not_ok:1; struct musb_hdrc_config *config; + const char *phy_name; #ifdef MUSB_CONFIG_PROC_FS struct proc_dir_entry *proc_entry; diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 6708a3b..5b6113a 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -352,7 +352,7 @@ static int omap2430_musb_init(struct musb *musb) musb->xceiv = devm_usb_get_phy_by_phandle(dev->parent, "usb-phy", 0); else - musb->xceiv = devm_usb_get_phy_dev(dev, 0); + musb->xceiv = devm_usb_get_phy_by_name(dev, musb->phy_name); if (IS_ERR(musb->xceiv)) { status = PTR_ERR(musb->xceiv);