Patchwork [3/3] usb: appledisplay: Remove unnecessary spinlock

login
register
mail settings
Submitter alex.theissen@me.com
Date Dec. 4, 2018, 10:43 p.m.
Message ID <20181204224337.29122-4-alex.theissen@me.com>
Download mbox | patch
Permalink /patch/672471/
State New
Headers show

Comments

alex.theissen@me.com - Dec. 4, 2018, 10:43 p.m.
From: Alexander Theissen <alex.theissen@me.com>

The spinlock was inside the urb completion function which is only
called once per display and is then resubmitted from this function.
There was no other place where this lock was used.

Signed-off-by: Alexander Theissen <alex.theissen@me.com>
---
 drivers/usb/misc/appledisplay.c | 7 -------
 1 file changed, 7 deletions(-)

Patch

diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 2f3c4769238d..ac92725458b5 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -69,7 +69,6 @@  struct appledisplay {
 
 	struct delayed_work work;
 	int button_pressed;
-	spinlock_t lock;
 	struct mutex sysfslock;		/* concurrent read and write */
 };
 
@@ -79,7 +78,6 @@  static void appledisplay_complete(struct urb *urb)
 {
 	struct appledisplay *pdata = urb->context;
 	struct device *dev = &pdata->udev->dev;
-	unsigned long flags;
 	int status = urb->status;
 	int retval;
 
@@ -105,8 +103,6 @@  static void appledisplay_complete(struct urb *urb)
 		goto exit;
 	}
 
-	spin_lock_irqsave(&pdata->lock, flags);
-
 	switch(pdata->urbdata[1]) {
 	case ACD_BTN_BRIGHT_UP:
 	case ACD_BTN_BRIGHT_DOWN:
@@ -119,8 +115,6 @@  static void appledisplay_complete(struct urb *urb)
 		break;
 	}
 
-	spin_unlock_irqrestore(&pdata->lock, flags);
-
 exit:
 	retval = usb_submit_urb(pdata->urb, GFP_ATOMIC);
 	if (retval) {
@@ -229,7 +223,6 @@  static int appledisplay_probe(struct usb_interface *iface,
 
 	pdata->udev = udev;
 
-	spin_lock_init(&pdata->lock);
 	INIT_DELAYED_WORK(&pdata->work, appledisplay_work);
 	mutex_init(&pdata->sysfslock);