Re: [PATCH 3/5 v2] usb: musb: Idle path retention and offmode support for OMAP3

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

 



Hi,

minor comment.

On Fri, Feb 25, 2011 at 06:54:04PM +0530, Hema HK wrote:
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index b6dcc7e..43c69a9 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -244,6 +244,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
>  		if (is_otg_enabled(musb)) {
>  #ifdef CONFIG_USB_GADGET_MUSB_HDRC
>  			if (musb->gadget_driver) {
> +				pm_runtime_get_sync(musb->controller);
>  				otg_init(musb->xceiv);
>  
>  				if (data->interface_type ==
> @@ -253,6 +254,7 @@ static int musb_otg_notifications(struct notifier_block *nb,
>  			}
>  #endif
>  		} else {
> +			pm_runtime_get_sync(musb->controller);
>  			otg_init(musb->xceiv);
>  			if (data->interface_type ==
>  					MUSB_INTERFACE_UTMI)
> @@ -263,12 +265,24 @@ static int musb_otg_notifications(struct notifier_block *nb,
>  	case USB_EVENT_VBUS:
>  		DBG(4, "VBUS Connect\n");
>  
> +		if (musb->gadget_driver)
> +			pm_runtime_get_sync(musb->controller);
> +
>  		otg_init(musb->xceiv);
>  		break;
>  
>  	case USB_EVENT_NONE:
>  		DBG(4, "VBUS Disconnect\n");
>  
> +#ifdef CONFIG_USB_GADGET_MUSB_HDRC
> +		if (is_otg_enabled(musb))
> +			if (musb->gadget_driver)
> +#endif
> +			{
> +				pm_runtime_mark_last_busy(musb->controller);
> +				pm_runtime_put_autosuspend(musb->controller);
> +			}
> +
>  		if (data->interface_type == MUSB_INTERFACE_UTMI) {
>  			if (musb->xceiv->set_vbus)
>  				otg_set_vbus(musb->xceiv, 0);
> @@ -300,7 +314,12 @@ static int omap2430_musb_init(struct musb *musb)
>  		return -ENODEV;
>  	}
>  
> -	omap2430_low_level_init(musb);
> +	status = pm_runtime_get_sync(dev);
> +	if (status < 0) {
> +		dev_err(dev, "pm_runtime_get_sync FAILED");
> +		pm_runtime_disable(dev);
> +		return -EINVAL;
> +	}

instead, you should use a goto here and update the error handling below
if you need.

-- 
balbi
--
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