summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/es2.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-06-27 20:07:11 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-06-29 16:37:17 -0700
commit07af934094ed7d79442dcec82305001e3a66ad6c (patch)
tree10ca49bdfd1a4478cade3ca7955b2dbeb0a5c67f /drivers/staging/greybus/es2.c
parent0b1d262354214daab1a3b7df763dc51c355ec353 (diff)
downloadop-kernel-dev-07af934094ed7d79442dcec82305001e3a66ad6c.zip
op-kernel-dev-07af934094ed7d79442dcec82305001e3a66ad6c.tar.gz
greybus: Revert "greybus: es2.c: don't use spin_lock_irq()"
This reverts commit b44c3b5b0307788750eb4c462ed5982236876a8b. 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/es2.c')
-rw-r--r--drivers/staging/greybus/es2.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/greybus/es2.c b/drivers/staging/greybus/es2.c
index 2217445..5bdf2e1 100644
--- a/drivers/staging/greybus/es2.c
+++ b/drivers/staging/greybus/es2.c
@@ -496,12 +496,11 @@ static void message_cancel(struct gb_message *message)
struct gb_host_device *hd = message->operation->connection->hd;
struct es2_ap_dev *es2 = hd_to_es2(hd);
struct urb *urb;
- unsigned long flags;
int i;
might_sleep();
- spin_lock_irqsave(&es2->cport_out_urb_lock, flags);
+ spin_lock_irq(&es2->cport_out_urb_lock);
urb = message->hcpriv;
/* Prevent dynamically allocated urb from being deallocated. */
@@ -514,14 +513,14 @@ static void message_cancel(struct gb_message *message)
break;
}
}
- spin_unlock_irqrestore(&es2->cport_out_urb_lock, flags);
+ spin_unlock_irq(&es2->cport_out_urb_lock);
usb_kill_urb(urb);
if (i < NUM_CPORT_OUT_URB) {
- spin_lock_irqsave(&es2->cport_out_urb_lock, flags);
+ spin_lock_irq(&es2->cport_out_urb_lock);
es2->cport_out_urb_cancelled[i] = false;
- spin_unlock_irqrestore(&es2->cport_out_urb_lock, flags);
+ spin_unlock_irq(&es2->cport_out_urb_lock);
}
usb_free_urb(urb);
OpenPOWER on IntegriCloud