Hi, On Tue, Oct 23, 2012 at 04:41:58PM -0700, Sarah Sharp wrote: > On Fri, Oct 19, 2012 at 10:55:16AM +0300, Felipe Balbi wrote: > > that check will have to be done by all users > > of xhci_suspend() so it sounds a lot better to > > move the check to xhci_suspend() in order to > > avoid code duplication. > > Hi Felipe, > > This looks fine. Do you want me to add it to my usb-next queue or do you > want to take it? I think you can take it, but if you could put this in a separate branch with just this patch so I can pull it in my queue just in case I need to solve conflicts, I'd be very happy. cheers > > Signed-off-by: Felipe Balbi <balbi@xxxxxx> > Acked-by: Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> > > > --- > > drivers/usb/host/xhci-pci.c | 9 +-------- > > drivers/usb/host/xhci.c | 4 ++++ > > 2 files changed, 5 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c > > index 8345d7c..aeb3973 100644 > > --- a/drivers/usb/host/xhci-pci.c > > +++ b/drivers/usb/host/xhci-pci.c > > @@ -218,15 +218,8 @@ static void xhci_pci_remove(struct pci_dev *dev) > > static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) > > { > > struct xhci_hcd *xhci = hcd_to_xhci(hcd); > > - int retval = 0; > > > > - if (hcd->state != HC_STATE_SUSPENDED || > > - xhci->shared_hcd->state != HC_STATE_SUSPENDED) > > - return -EINVAL; > > - > > - retval = xhci_suspend(xhci); > > - > > - return retval; > > + return xhci_suspend(xhci); > > } > > > > static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > > index 8d7fcbb..b85029e 100644 > > --- a/drivers/usb/host/xhci.c > > +++ b/drivers/usb/host/xhci.c > > @@ -879,6 +879,10 @@ int xhci_suspend(struct xhci_hcd *xhci) > > struct usb_hcd *hcd = xhci_to_hcd(xhci); > > u32 command; > > > > + if (hcd->state != HC_STATE_SUSPENDED || > > + xhci->shared_hcd->state != HC_STATE_SUSPENDED) > > + return -EINVAL; > > + > > spin_lock_irq(&xhci->lock); > > clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); > > clear_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags); > > -- > > 1.8.0.rc0 > > -- balbi
Attachment:
signature.asc
Description: Digital signature