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

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

 



Vikram,

> -----Original Message-----
> From: Pandita, Vikram
> Sent: Saturday, September 05, 2009 4:35 AM
> To: linux-usb@xxxxxxxxxxxxxxx
> Cc: linux-omap@xxxxxxxxxxxxxxx; david-b@xxxxxxxxxxx; Gupta, Ajay Kumar;
> Gadiyar, Anand; felipe.balbi@xxxxxxxxx; Pandita, Vikram
> Subject: [PATCH 2/3] USB: musb: omap: Fix wrong xceivr passing to twl4030
> 
> 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
> 

musb->xceiv is also taken from otg_get_transceiver() in musb_platform_init(). So this patch is not required.

-Ajay

> 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-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux