summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/u_fs.h
diff options
context:
space:
mode:
authorMichal Nazarewicz <mina86@mina86.com>2014-02-10 10:42:41 +0100
committerFelipe Balbi <balbi@ti.com>2014-02-18 10:53:00 -0600
commita7ecf0544f0fc710ba6e2ff751d328a4190c4a1f (patch)
treecdfad1ce937dc22085e12fbe3cb2f7e31fbb9022 /drivers/usb/gadget/u_fs.h
parente46318a00091e3e009363a516acc44a4a80e2ebb (diff)
downloadop-kernel-dev-a7ecf0544f0fc710ba6e2ff751d328a4190c4a1f.zip
op-kernel-dev-a7ecf0544f0fc710ba6e2ff751d328a4190c4a1f.tar.gz
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.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/gadget/u_fs.h b/drivers/usb/gadget/u_fs.h
index 38012bc..78263cc 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];
OpenPOWER on IntegriCloud