aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-dbg.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2011-08-18 16:31:30 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-08-22 18:57:01 -0400
commite8799906045302776b35b66b16495c575db3b69c (patch)
treee6b5a76bd13ef0a9df24f7a7c8c1e924c0efcedb /drivers/usb/host/ehci-dbg.c
parentdfd8c81fd1c09c740140a2334669994d5c6edcaa (diff)
USB: EHCI: remove usages of hcd->state
This patch (as1483) improves the ehci-hcd driver family by getting rid of the reliance on the hcd->state variable. It has no clear owner and it isn't protected by the usual HCD locks. In its place, the patch adds a new, private ehci->rh_state field to record the state of the root hub. Along the way, the patch removes a couple of lines containing redundant assignments to the state variable. Also, the QUIESCING state simply gets changed to the RUNNING state, because the driver doesn't make any distinction between them. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ehci-dbg.c')
-rw-r--r--drivers/usb/host/ehci-dbg.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 40a844c1dbb4..9952505d2357 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -697,6 +697,19 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
697} 697}
698#undef DBG_SCHED_LIMIT 698#undef DBG_SCHED_LIMIT
699 699
700static const char *rh_state_string(struct ehci_hcd *ehci)
701{
702 switch (ehci->rh_state) {
703 case EHCI_RH_HALTED:
704 return "halted";
705 case EHCI_RH_SUSPENDED:
706 return "suspended";
707 case EHCI_RH_RUNNING:
708 return "running";
709 }
710 return "?";
711}
712
700static ssize_t fill_registers_buffer(struct debug_buffer *buf) 713static ssize_t fill_registers_buffer(struct debug_buffer *buf)
701{ 714{
702 struct usb_hcd *hcd; 715 struct usb_hcd *hcd;
@@ -730,11 +743,11 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
730 temp = scnprintf (next, size, 743 temp = scnprintf (next, size,
731 "bus %s, device %s\n" 744 "bus %s, device %s\n"
732 "%s\n" 745 "%s\n"
733 "EHCI %x.%02x, hcd state %d\n", 746 "EHCI %x.%02x, rh state %s\n",
734 hcd->self.controller->bus->name, 747 hcd->self.controller->bus->name,
735 dev_name(hcd->self.controller), 748 dev_name(hcd->self.controller),
736 hcd->product_desc, 749 hcd->product_desc,
737 i >> 8, i & 0x0ff, hcd->state); 750 i >> 8, i & 0x0ff, rh_state_string(ehci));
738 size -= temp; 751 size -= temp;
739 next += temp; 752 next += temp;
740 753