diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-06-22 16:39:10 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 14:35:37 -0700 |
commit | 541c7d432f76771079e7c295d596ea47cc6a3030 (patch) | |
tree | 9e04330713366d21849cecf0f3fd2f2c1834574d /drivers/usb/host/oxu210hp-hcd.c | |
parent | 89ba85d4015b7fa738b35bcc228075c117a9a578 (diff) |
USB: convert usb_hcd bitfields into atomic flags
This patch (as1393) converts several of the single-bit fields in
struct usb_hcd to atomic flags. This is for safety's sake; not all
CPUs can update bitfield values atomically, and these flags are used
in multiple contexts.
The flag fields that are set only during registration or removal can
remain as they are, since non-atomic accesses at those times will not
cause any problems.
(Strictly speaking, the authorized_default flag should become atomic
as well. I didn't bother with it because it gets changed only via
sysfs. It can be done later, if anyone wants.)
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/oxu210hp-hcd.c')
-rw-r--r-- | drivers/usb/host/oxu210hp-hcd.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index f608dfd09a8a..d9c85a292737 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -1641,8 +1641,7 @@ static int submit_async(struct oxu_hcd *oxu, struct urb *urb, #endif spin_lock_irqsave(&oxu->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &oxu_to_hcd(oxu)->flags))) { + if (unlikely(!HCD_HW_ACCESSIBLE(oxu_to_hcd(oxu)))) { rc = -ESHUTDOWN; goto done; } @@ -2209,8 +2208,7 @@ static int intr_submit(struct oxu_hcd *oxu, struct urb *urb, spin_lock_irqsave(&oxu->lock, flags); - if (unlikely(!test_bit(HCD_FLAG_HW_ACCESSIBLE, - &oxu_to_hcd(oxu)->flags))) { + if (unlikely(!HCD_HW_ACCESSIBLE(oxu_to_hcd(oxu)))) { status = -ESHUTDOWN; goto done; } @@ -2715,7 +2713,6 @@ static int oxu_run(struct usb_hcd *hcd) u32 temp, hcc_params; hcd->uses_new_polling = 1; - hcd->poll_rh = 0; /* EHCI spec section 4.1 */ retval = ehci_reset(oxu); |