auxdisplay: Remove in_interrupt() usage.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Tue, 16 Feb 2021 18:27:14 +0000 (19:27 +0100)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 16 Mar 2021 15:32:40 +0000 (16:32 +0100)
commit701454bce906241ba7f50e2773881560d6404d29
treec37ca8b84e8ca8f626dfea29d07831af9b18d571
parent1e28eed17697bcf343c6743f0028cc3b5dd88bf0
auxdisplay: Remove in_interrupt() usage.

charlcd_write() is invoked as a VFS->write() callback and as such it is
always invoked from preemptible context and may sleep.

charlcd_puts() is invoked from register/unregister callback which is
preemptible. The reboot notifier callback is also invoked from
preemptible context.

Therefore there is no need to use in_interrupt() to figure out if it
is safe to sleep because it always is. in_interrupt() and related
context checks are being removed from non-core code.
Using schedule() to schedule (and be friendly to others) is
discouraged and cond_resched() should be used instead.

Remove in_interrupt() and use cond_resched() to schedule every 32
iterations if needed.

Link: https://lkml.kernel.org/r/20200914204209.256266093@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[mo: fixed a couple typos in comment and commit message]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
drivers/auxdisplay/charlcd.c