tty: max310x: Simplify tx-work item code
authorSerge Semin <fancer.lancer@gmail.com>
Tue, 14 May 2019 10:14:09 +0000 (13:14 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 May 2019 10:15:53 +0000 (12:15 +0200)
commit2987590b7846bc55530d02fcb568ce338a1e5bdd
tree320098114261d93a08afd6cc8b21bc1aea6d3b96
parent9f20e8843edf35a0e4869f9e52b0494cfb1c91fc
tty: max310x: Simplify tx-work item code

Since cmwq introduction in the kernel, workqueues've been turned into
non-reentrant execution contexts [1]. It means any work item is
guaranteed to be executed by at most one worker system-wide at any
given time. Since tx-handler max310x_handle_tx() is called by a
single work item we don't need it to be self-protected by the mutex.
We also don't need to check the tx work item pending state before
scheduling it (which in the first place was racy btw), since cmwq will
make sure to reschedule the item if it wasn't pending at the moment of
schedule_work() call.

[1] Documentation/core-api/workqueue.rst

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c