Re: [PATCH 02/13] ehci: Support for Intel Moorestown MPH and OTG host

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

 



On Thu, 5 Aug 2010, Alan Cox wrote:

> From: Alek Du <alek.du@xxxxxxxxx>
> 
> The Intel Moorestown platform has EHCI MPH and EHCI OTG host. This patch adds
> PCI probe part for them. The HNP part and SRAM part will be added in another
> patch. This patch depends on the OTG transceive and OTG client patch from Hang
> Yuan that should be accepted already.

Just noticed this...

> diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
> index 796ea0c..86f0815 100644
> --- a/drivers/usb/host/ehci-hub.c
> +++ b/drivers/usb/host/ehci-hub.c
> @@ -178,6 +178,7 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
>  	int			port;
>  	int			mask;
>  	int			changed;
> +	int			rc = 0;
>  
>  	ehci_dbg(ehci, "suspend root hub\n");
>  
> @@ -297,13 +298,17 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
>  	ehci_readl(ehci, &ehci->regs->intr_enable);
>  
>  	ehci->next_statechange = jiffies + msecs_to_jiffies(10);
> +
> +	if (ehci->has_otg && ehci->otg_suspend)
> +		rc = ehci->otg_suspend(hcd);
> +
>  	spin_unlock_irq (&ehci->lock);
>  
>  	/* ehci_work() may have re-enabled the watchdog timer, which we do not
>  	 * want, and so we must delete any pending watchdog timer events.
>  	 */
>  	del_timer_sync(&ehci->watchdog);
> -	return 0;
> +	return rc;
>  }

What happens when the otg_suspend callback fails?  Returning an error 
code isn't good enough; you also have to undo all the earlier work that 
was done in ehci_bus_suspend().

Alan Stern

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