Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 019a35f1 authored by Andiry Xu's avatar Andiry Xu Committed by Sarah Sharp
Browse files

xHCI: Remove redundant variable in xhci_resume()



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: default avatarAndiry Xu <andiry.xu@amd.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 518e848e
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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;