Commit e46318a0 authored by Michal Nazarewicz's avatar Michal Nazarewicz Committed by Felipe Balbi

usb: gadget: functionfs: fix typo in the enum variable

Since “cancelled” is spelled with two “l”s, rename FFS_SETUP_CANCELED
to FFS_SETUP_CANCELLED.
Signed-off-by: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent da13a773
...@@ -246,7 +246,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf, ...@@ -246,7 +246,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
ENTER(); ENTER();
/* Fast check if setup was canceled */ /* Fast check if setup was canceled */
if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELED) if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELLED)
return -EIDRM; return -EIDRM;
/* Acquire mutex */ /* Acquire mutex */
...@@ -313,7 +313,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf, ...@@ -313,7 +313,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
*/ */
spin_lock_irq(&ffs->ev.waitq.lock); spin_lock_irq(&ffs->ev.waitq.lock);
switch (FFS_SETUP_STATE(ffs)) { switch (FFS_SETUP_STATE(ffs)) {
case FFS_SETUP_CANCELED: case FFS_SETUP_CANCELLED:
ret = -EIDRM; ret = -EIDRM;
goto done_spin; goto done_spin;
...@@ -348,7 +348,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf, ...@@ -348,7 +348,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
/* /*
* We are guaranteed to be still in FFS_ACTIVE state * We are guaranteed to be still in FFS_ACTIVE state
* but the state of setup could have changed from * but the state of setup could have changed from
* FFS_SETUP_PENDING to FFS_SETUP_CANCELED so we need * FFS_SETUP_PENDING to FFS_SETUP_CANCELLED so we need
* to check for that. If that happened we copied data * to check for that. If that happened we copied data
* from user space in vain but it's unlikely. * from user space in vain but it's unlikely.
* *
...@@ -357,7 +357,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf, ...@@ -357,7 +357,7 @@ static ssize_t ffs_ep0_write(struct file *file, const char __user *buf,
* transition can be performed and it's protected by * transition can be performed and it's protected by
* mutex. * mutex.
*/ */
if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELED) { if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELLED) {
ret = -EIDRM; ret = -EIDRM;
done_spin: done_spin:
spin_unlock_irq(&ffs->ev.waitq.lock); spin_unlock_irq(&ffs->ev.waitq.lock);
...@@ -423,7 +423,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf, ...@@ -423,7 +423,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf,
ENTER(); ENTER();
/* Fast check if setup was canceled */ /* Fast check if setup was canceled */
if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELED) if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELLED)
return -EIDRM; return -EIDRM;
/* Acquire mutex */ /* Acquire mutex */
...@@ -444,7 +444,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf, ...@@ -444,7 +444,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf,
spin_lock_irq(&ffs->ev.waitq.lock); spin_lock_irq(&ffs->ev.waitq.lock);
switch (FFS_SETUP_STATE(ffs)) { switch (FFS_SETUP_STATE(ffs)) {
case FFS_SETUP_CANCELED: case FFS_SETUP_CANCELLED:
ret = -EIDRM; ret = -EIDRM;
break; break;
...@@ -491,7 +491,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf, ...@@ -491,7 +491,7 @@ static ssize_t ffs_ep0_read(struct file *file, char __user *buf,
spin_lock_irq(&ffs->ev.waitq.lock); spin_lock_irq(&ffs->ev.waitq.lock);
/* See ffs_ep0_write() */ /* See ffs_ep0_write() */
if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELED) { if (FFS_SETUP_STATE(ffs) == FFS_SETUP_CANCELLED) {
ret = -EIDRM; ret = -EIDRM;
break; break;
} }
...@@ -1786,7 +1786,7 @@ static void __ffs_event_add(struct ffs_data *ffs, ...@@ -1786,7 +1786,7 @@ static void __ffs_event_add(struct ffs_data *ffs,
* the source does nothing. * the source does nothing.
*/ */
if (ffs->setup_state == FFS_SETUP_PENDING) if (ffs->setup_state == FFS_SETUP_PENDING)
ffs->setup_state = FFS_SETUP_CANCELED; ffs->setup_state = FFS_SETUP_CANCELLED;
switch (type) { switch (type) {
case FUNCTIONFS_RESUME: case FUNCTIONFS_RESUME:
......
...@@ -123,7 +123,7 @@ enum ffs_setup_state { ...@@ -123,7 +123,7 @@ enum ffs_setup_state {
* setup. If this state is set read/write on ep0 return * setup. If this state is set read/write on ep0 return
* -EIDRM. This state is only set when adding event. * -EIDRM. This state is only set when adding event.
*/ */
FFS_SETUP_CANCELED FFS_SETUP_CANCELLED
}; };
struct ffs_data { struct ffs_data {
...@@ -170,14 +170,14 @@ struct ffs_data { ...@@ -170,14 +170,14 @@ struct ffs_data {
* happens only in ep0 read which is P: mutex * happens only in ep0 read which is P: mutex
* + FFS_SETUP_PENDING -> FFS_NO_SETUP -- P: ev.waitq.lock * + FFS_SETUP_PENDING -> FFS_NO_SETUP -- P: ev.waitq.lock
* happens only in ep0 i/o which is P: mutex * happens only in ep0 i/o which is P: mutex
* + FFS_SETUP_PENDING -> FFS_SETUP_CANCELED -- P: ev.waitq.lock * + FFS_SETUP_PENDING -> FFS_SETUP_CANCELLED -- P: ev.waitq.lock
* + FFS_SETUP_CANCELED -> FFS_NO_SETUP -- cmpxchg * + FFS_SETUP_CANCELLED -> FFS_NO_SETUP -- cmpxchg
*/ */
enum ffs_setup_state setup_state; enum ffs_setup_state setup_state;
#define FFS_SETUP_STATE(ffs) \ #define FFS_SETUP_STATE(ffs) \
((enum ffs_setup_state)cmpxchg(&(ffs)->setup_state, \ ((enum ffs_setup_state)cmpxchg(&(ffs)->setup_state, \
FFS_SETUP_CANCELED, FFS_NO_SETUP)) FFS_SETUP_CANCELLED, FFS_NO_SETUP))
/* Events & such. */ /* Events & such. */
struct { struct {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment