aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/uart.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-06-27 20:07:12 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-29 16:37:17 -0700
commit2aae92bdc25325cfd782cc76842a4302540958f2 (patch)
treeccbe84067681c99e2cb41c914b745b2da9e4053e /drivers/staging/greybus/uart.c
parentgreybus: Revert "greybus: es2.c: don't use spin_lock_irq()" (diff)
downloadlinux-dev-2aae92bdc25325cfd782cc76842a4302540958f2.tar.xz
linux-dev-2aae92bdc25325cfd782cc76842a4302540958f2.zip
greybus: Revert "greybus: uart: don't use spin_lock_irq()"
This reverts commit bd3c4aa99dc23449699432e0744bcb5af7afa98c. Someone decided that all use of spin_lock_irq was to be considered a bug and went on a search-and-replace type "bug-fixing" spree last week. This is however just plain wrong. Using spin_lock_irq is perfectly fine in paths were interrupts have not been disabled, and this is in fact even preferred over the lazy approach of always using spin_lock_irqsave instead of understanding the code that is being written or modified. All current uses of spin_lock_irq have already been vetted in this respect. Also note that it is only used in functions that may sleep, that is, in functions that must not be called with interrupts disabled in the first place. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/uart.c')
-rw-r--r--drivers/staging/greybus/uart.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 80896385c1cb..6260569b2f25 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -674,7 +674,6 @@ static int set_serial_info(struct gb_tty *gb_tty,
static int wait_serial_change(struct gb_tty *gb_tty, unsigned long arg)
{
int retval = 0;
- unsigned long flags;
DECLARE_WAITQUEUE(wait, current);
struct async_icount old;
struct async_icount new;
@@ -683,11 +682,11 @@ static int wait_serial_change(struct gb_tty *gb_tty, unsigned long arg)
return -EINVAL;
do {
- spin_lock_irqsave(&gb_tty->read_lock, flags);
+ spin_lock_irq(&gb_tty->read_lock);
old = gb_tty->oldcount;
new = gb_tty->iocount;
gb_tty->oldcount = new;
- spin_unlock_irqrestore(&gb_tty->read_lock, flags);
+ spin_unlock_irq(&gb_tty->read_lock);
if ((arg & TIOCM_DSR) && (old.dsr != new.dsr))
break;