diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2005-04-09 17:26:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-27 17:43:43 -0400 |
commit | f5946f8220a866dcdb8edc6abe23c1443e252425 (patch) | |
tree | 3984d5eb8382d3bc694168e90957206d97fd7d1c /drivers/usb/host/uhci-hub.c | |
parent | 014e73c99aa408f3766afe8d11a1caa3a708b736 (diff) |
[PATCH] USB UHCI: Minor improvements
This patch makes a few small improvements in the UHCI driver. Some
code is moved between different source files and a more useful pointer
is passed to a callback routine.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/uhci-hub.c')
-rw-r--r-- | drivers/usb/host/uhci-hub.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c index 4c45ba8390f8..ddb19cbf4b75 100644 --- a/drivers/usb/host/uhci-hub.c +++ b/drivers/usb/host/uhci-hub.c | |||
@@ -33,6 +33,22 @@ static __u8 root_hub_hub_des[] = | |||
33 | /* status change bits: nonzero writes will clear */ | 33 | /* status change bits: nonzero writes will clear */ |
34 | #define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) | 34 | #define RWC_BITS (USBPORTSC_OCC | USBPORTSC_PEC | USBPORTSC_CSC) |
35 | 35 | ||
36 | /* A port that either is connected or has a changed-bit set will prevent | ||
37 | * us from AUTO_STOPPING. | ||
38 | */ | ||
39 | static int any_ports_active(struct uhci_hcd *uhci) | ||
40 | { | ||
41 | int port; | ||
42 | |||
43 | for (port = 0; port < uhci->rh_numports; ++port) { | ||
44 | if ((inw(uhci->io_addr + USBPORTSC1 + port * 2) & | ||
45 | (USBPORTSC_CCS | RWC_BITS)) || | ||
46 | test_bit(port, &uhci->port_c_suspend)) | ||
47 | return 1; | ||
48 | } | ||
49 | return 0; | ||
50 | } | ||
51 | |||
36 | static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) | 52 | static int uhci_hub_status_data(struct usb_hcd *hcd, char *buf) |
37 | { | 53 | { |
38 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 54 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |