staging: pi433: cleanup tx_fifo locking
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Thu, 19 Apr 2018 10:25:30 +0000 (12:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 13:40:24 +0000 (15:40 +0200)
commit5451dab9b7f5469b1499d09e15493ca54ec0d7da
tree1bb1d3a5fd9f4c2c496223d0aeffee8e560e8377
parent1dab154ef1a44933a07c0968ecd34b194ff260eb
staging: pi433: cleanup tx_fifo locking

pi433_write requires locking due to multiple writers.  After acquiring
the lock check if enough free space is available in the kfifo to write
the whole message. This check should prevent partial writes to tx_fifo
so kfifo_reset is not needed anymore.

pi433_tx_thread is the only reader so it does not require locking
after kfifo_reset is removed.

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Reviewed-by: Marcus Wolf <marcus.wolf@wolf-entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c