Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: appledisplay: Remove unnecessary spinlock

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Alexander Theissen and committed by
Greg Kroah-Hartman
3ea5eb13 67f3a0d0

-7
-7
drivers/usb/misc/appledisplay.c
··· 68 68 69 69 struct delayed_work work; 70 70 int button_pressed; 71 - spinlock_t lock; 72 71 struct mutex sysfslock; /* concurrent read and write */ 73 72 }; 74 73 ··· 77 78 { 78 79 struct appledisplay *pdata = urb->context; 79 80 struct device *dev = &pdata->udev->dev; 80 - unsigned long flags; 81 81 int status = urb->status; 82 82 int retval; 83 83 ··· 102 104 goto exit; 103 105 } 104 106 105 - spin_lock_irqsave(&pdata->lock, flags); 106 - 107 107 switch(pdata->urbdata[1]) { 108 108 case ACD_BTN_BRIGHT_UP: 109 109 case ACD_BTN_BRIGHT_DOWN: ··· 113 117 pdata->button_pressed = 0; 114 118 break; 115 119 } 116 - 117 - spin_unlock_irqrestore(&pdata->lock, flags); 118 120 119 121 exit: 120 122 retval = usb_submit_urb(pdata->urb, GFP_ATOMIC); ··· 222 228 223 229 pdata->udev = udev; 224 230 225 - spin_lock_init(&pdata->lock); 226 231 INIT_DELAYED_WORK(&pdata->work, appledisplay_work); 227 232 mutex_init(&pdata->sysfslock); 228 233