usb: cdc-acm: Kill ACM_READY() macro completely
The ACM_READY() macro doesn't seem to do anything useful, and it may prevent tty_wait_until_sent() from working properly when called from close. Previously, acm_tty_chars_in_buffer() returned 0 whenever acm->port.count was 0. This means close() could return before all the data has actually been written. Signed-off-by: Havard Skinnemoen <hskinnemoen@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
7bf01185c5
commit
99823f457d
1 changed files with 1 additions and 9 deletions
|
@ -60,8 +60,6 @@ static struct acm *acm_table[ACM_TTY_MINORS];
|
||||||
|
|
||||||
static DEFINE_MUTEX(acm_table_lock);
|
static DEFINE_MUTEX(acm_table_lock);
|
||||||
|
|
||||||
#define ACM_READY(acm) (acm && acm->dev && acm->port.count)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* acm_table accessors
|
* acm_table accessors
|
||||||
*/
|
*/
|
||||||
|
@ -319,9 +317,6 @@ static void acm_ctrl_irq(struct urb *urb)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ACM_READY(acm))
|
|
||||||
goto exit;
|
|
||||||
|
|
||||||
usb_mark_last_busy(acm->dev);
|
usb_mark_last_busy(acm->dev);
|
||||||
|
|
||||||
data = (unsigned char *)(dr + 1);
|
data = (unsigned char *)(dr + 1);
|
||||||
|
@ -481,7 +476,6 @@ static void acm_write_bulk(struct urb *urb)
|
||||||
spin_lock_irqsave(&acm->write_lock, flags);
|
spin_lock_irqsave(&acm->write_lock, flags);
|
||||||
acm_write_done(acm, wb);
|
acm_write_done(acm, wb);
|
||||||
spin_unlock_irqrestore(&acm->write_lock, flags);
|
spin_unlock_irqrestore(&acm->write_lock, flags);
|
||||||
if (ACM_READY(acm))
|
|
||||||
schedule_work(&acm->work);
|
schedule_work(&acm->work);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,8 +486,6 @@ static void acm_softint(struct work_struct *work)
|
||||||
|
|
||||||
dev_vdbg(&acm->data->dev, "%s\n", __func__);
|
dev_vdbg(&acm->data->dev, "%s\n", __func__);
|
||||||
|
|
||||||
if (!ACM_READY(acm))
|
|
||||||
return;
|
|
||||||
tty = tty_port_tty_get(&acm->port);
|
tty = tty_port_tty_get(&acm->port);
|
||||||
if (!tty)
|
if (!tty)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue