The driver invokes mb() after setting the stopped flag in ads7846_stop()
and ads7846_restart(). These mandatory barriers lack pairing barriers on
the reader side and are unnecessary.
The wait queue operations wake_up() and wait_event_timeout(), along
with disable_irq() and enable_irq(), already provide the required
synchronization and memory ordering when stopping and restarting the
device polling. Remove the redundant barriers.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/input/touchscreen/ads7846.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index f1827684c902..6352117cd898 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -235,7 +235,6 @@ static void ads7846_stop(struct ads7846 *ts)
if (!ts->disabled && !ts->suspended) {
/* Signal IRQ thread to stop polling and disable the handler. */
ts->stopped = true;
- mb();
wake_up(&ts->wait);
disable_irq(ts->spi->irq);
}@@ -251,7 +250,6 @@ static void ads7846_restart(struct ads7846 *ts)
/* Tell IRQ thread that it may poll the device. */
ts->stopped = false;
- mb();
enable_irq(ts->spi->irq);
}
}
--
2.56.0.567.gdb80ae8cd5-goog