From patchwork Fri Sep 4 23:04:59 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vikram pandita X-Patchwork-Id: 45806 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n84NB0qm017569 for ; Fri, 4 Sep 2009 23:11:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934474AbZIDXKy (ORCPT ); Fri, 4 Sep 2009 19:10:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934470AbZIDXKy (ORCPT ); Fri, 4 Sep 2009 19:10:54 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:50652 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934455AbZIDXKx (ORCPT ); Fri, 4 Sep 2009 19:10:53 -0400 Received: from dlep36.itg.ti.com ([157.170.170.91]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id n84NAknH012421; Fri, 4 Sep 2009 18:10:51 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep36.itg.ti.com (8.13.8/8.13.8) with ESMTP id n84NAh4w000238; Fri, 4 Sep 2009 18:10:43 -0500 (CDT) Received: from vip-tid (lta0307903-128247075087.am.dhcp.ti.com [128.247.75.87]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id n84NAhZ11769; Fri, 4 Sep 2009 18:10:43 -0500 (CDT) Received: from vip-tid (localhost.localdomain [127.0.0.1]) by vip-tid (Postfix) with ESMTP id 0932129A4FD; Fri, 4 Sep 2009 18:05:01 -0500 (CDT) Received: (from vikram@localhost) by vip-tid (8.14.3/8.14.3/Submit) id n84N51c7019035; Fri, 4 Sep 2009 18:05:01 -0500 X-Authentication-Warning: vip-tid: vikram set sender to vikram.pandita@ti.com using -f From: Vikram Pandita To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, david-b@pacbell.net, ajay.gupta@ti.com, gadiyar@ti.com, felipe.balbi@nokia.com, Vikram Pandita Subject: [PATCH 2/3] USB: musb: omap: Fix wrong xceivr passing to twl4030 Date: Fri, 4 Sep 2009 18:04:59 -0500 Message-Id: <1252105499-19003-1-git-send-email-vikram.pandita@ti.com> X-Mailer: git-send-email 1.6.3.3.334.g916e1 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Wrong pointer was getting passed to twl4030 transceiver. Call path is: otg_set_suspend -> twl4030_set_suspend drivers/usb/otg/twl4030-usb.c: twl4030_set_suspend() uses: struct twl4030_usb *twl = xceiv_to_twl(x); and xceiv_to_twl is container_of() So the same pointer needs to be passed to otg_set_suspend() as has been used for otg_set_transceiver. A crash is seen without this patch, as twl pointer access is worng Signed-off-by: Vikram Pandita --- drivers/usb/musb/omap2430.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index b957575..ea7a798 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -269,7 +269,7 @@ int musb_platform_suspend(struct musb *musb) l |= ENABLEWAKEUP; /* enable wakeup */ omap_writel(l, OTG_SYSCONFIG); - otg_set_suspend(musb->xceiv, 1); + otg_set_suspend(otg_get_transceiver(), 1); if (musb->set_clock) musb->set_clock(musb->clock, 0); @@ -286,7 +286,7 @@ int musb_platform_resume(struct musb *musb) if (!musb->clock) return 0; - otg_set_suspend(musb->xceiv, 0); + otg_set_suspend(otg_get_transceiver(), 0); if (musb->set_clock) musb->set_clock(musb->clock, 1);