serial: ns16550: Simplify poll out
Simplify poll_out loop. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
459dde17e5
commit
1cd5578539
1 changed files with 3 additions and 9 deletions
|
@ -539,17 +539,11 @@ static void uart_ns16550_poll_out(struct device *dev,
|
||||||
{
|
{
|
||||||
k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock);
|
k_spinlock_key_t key = k_spin_lock(&DEV_DATA(dev)->lock);
|
||||||
|
|
||||||
while (1) {
|
while ((INBYTE(LSR(dev)) & LSR_THRE) == 0) {
|
||||||
/* wait for transmitter to ready to accept a character */
|
|
||||||
if ((INBYTE(LSR(dev)) & LSR_THRE) == 0) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
OUTBYTE(THR(dev), c);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OUTBYTE(THR(dev), c);
|
||||||
|
|
||||||
k_spin_unlock(&DEV_DATA(dev)->lock, key);
|
k_spin_unlock(&DEV_DATA(dev)->lock, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue