[PATCH 2/3] USB: musb: omap: Fix wrong xceivr passing to twl4030

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <vikram.pandita@xxxxxx>
---
 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);
-- 
1.6.3.3.334.g916e1

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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux