diff options
author | Michal Nazarewicz <mina86@mina86.com> | 2014-02-10 13:42:41 +0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-02-18 20:53:00 +0400 |
commit | a7ecf0544f0fc710ba6e2ff751d328a4190c4a1f (patch) | |
tree | cdfad1ce937dc22085e12fbe3cb2f7e31fbb9022 /drivers/usb/gadget/u_fs.h | |
parent | e46318a00091e3e009363a516acc44a4a80e2ebb (diff) | |
download | linux-a7ecf0544f0fc710ba6e2ff751d328a4190c4a1f.tar.xz |
usb: gadget: functionfs: replace FFS_SETUP_STATUS with an inline function
The FFS_SETUP_STATUS macro could be trivialy replaced with an static
inline function but more importantly its name was tad confusing.
The name suggested it was a simple accessor macro but it actually
did change the state of the ffs_data structure perfomring
a FFS_SETUP_CANCELLED -> FFS_NO_SETUP transition. The name of the
function -- ffs_setup_state_clear_cancelled -- should better
describe what the function actually does.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/u_fs.h')
-rw-r--r-- | drivers/usb/gadget/u_fs.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/gadget/u_fs.h b/drivers/usb/gadget/u_fs.h index 38012bcfe9ec..78263cc36df8 100644 --- a/drivers/usb/gadget/u_fs.h +++ b/drivers/usb/gadget/u_fs.h @@ -172,13 +172,12 @@ struct ffs_data { * happens only in ep0 i/o which is P: mutex * + FFS_SETUP_PENDING -> FFS_SETUP_CANCELLED -- P: ev.waitq.lock * + FFS_SETUP_CANCELLED -> FFS_NO_SETUP -- cmpxchg + * + * This field should never be accessed directly and instead + * ffs_setup_state_clear_cancelled function should be used. */ enum ffs_setup_state setup_state; -#define FFS_SETUP_STATE(ffs) \ - ((enum ffs_setup_state)cmpxchg(&(ffs)->setup_state, \ - FFS_SETUP_CANCELLED, FFS_NO_SETUP)) - /* Events & such. */ struct { u8 types[4]; |