]> git.baikalelectronics.ru Git - kernel.git/commit
net: natsemi: Replace in_interrupt() usage.
authorThomas Gleixner <tglx@linutronix.de>
Tue, 29 Sep 2020 20:25:23 +0000 (22:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2020 21:02:54 +0000 (14:02 -0700)
commit20e9667e6787be5739a4617c88c8225f4cb26ed2
tree041bcc77615316cb2b14d3c93bc9018a2d7fefd6
parent012908082a4559c1f7d7568495d42bd73a8daddc
net: natsemi: Replace in_interrupt() usage.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be seperated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

sonic_quiesce() uses 'in_interrupt() || irqs_disabled()' to chose either
udelay() or usleep_range() in the wait loop.

In all callchains leading to it the context is well defined and known.

Add a 'may_sleep' argument and pass it through the various callchains
leading to this function.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/natsemi/sonic.c
drivers/net/ethernet/natsemi/sonic.h