]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xHCI: Remove redundant variable in xhci_resume()
authorAndiry Xu <andiry.xu@amd.com>
Thu, 6 Jan 2011 07:43:17 +0000 (15:43 +0800)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Mon, 14 Mar 2011 01:07:09 +0000 (18:07 -0700)
Set hcd->state = HC_STATE_SUSPENDED if there is a power loss during system
resume or the system is hibernated, otherwise leave it be. The variable
old_state is redundant and made an unreachable code path, so remove it.

Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
drivers/usb/host/xhci.c

index 64f82b999221bad291183e3e53c58f86a3f8bed7..023175eab07d59be5818bfa987ce6bb1052e452c 100644 (file)
@@ -696,9 +696,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 {
        u32                     command, temp = 0;
        struct usb_hcd          *hcd = xhci_to_hcd(xhci);
-       int     old_state, retval;
+       int                     retval;
 
-       old_state = hcd->state;
        if (time_before(jiffies, xhci->next_statechange))
                msleep(100);
 
@@ -782,10 +781,6 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
         */
 
        set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
-       if (!hibernated)
-               hcd->state = old_state;
-       else
-               hcd->state = HC_STATE_SUSPENDED;
 
        spin_unlock_irq(&xhci->lock);
        return 0;