aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-picolcd_lcd.c
diff options
context:
space:
mode:
authorBruno Prémont <bonbons@linux-vserver.org>2012-07-30 15:38:57 -0400
committerJiri Kosina <jkosina@suse.cz>2012-08-15 04:13:26 -0400
commita93ab8494873a88622bf74be861a93f875643524 (patch)
tree19f76ccf334ffb78b387b10c047df61f44d8fa07 /drivers/hid/hid-picolcd_lcd.c
parentbaacf9c5d2e631e7c940527ad670c8d4b019da81 (diff)
HID: picoLCD: Improve unplug handling
Stop earlier attempting to submit new reports/URBs (though locking and usbhid still prevents to bail out early enough to not produce multiple hid-picolcd 0003:04D8:C002.0003: usb_submit_urb(out) failed: -19 messages in kernel log. Strengthen framebuffer removal to be less racy. Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-picolcd_lcd.c')
-rw-r--r--drivers/hid/hid-picolcd_lcd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-picolcd_lcd.c b/drivers/hid/hid-picolcd_lcd.c
index 64a067fc837c..2d0ddc5ac65f 100644
--- a/drivers/hid/hid-picolcd_lcd.c
+++ b/drivers/hid/hid-picolcd_lcd.c
@@ -47,7 +47,8 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)
47 data->lcd_contrast = contrast & 0x0ff; 47 data->lcd_contrast = contrast & 0x0ff;
48 spin_lock_irqsave(&data->lock, flags); 48 spin_lock_irqsave(&data->lock, flags);
49 hid_set_field(report->field[0], 0, data->lcd_contrast); 49 hid_set_field(report->field[0], 0, data->lcd_contrast);
50 usbhid_submit_report(data->hdev, report, USB_DIR_OUT); 50 if (!(data->status & PICOLCD_FAILED))
51 usbhid_submit_report(data->hdev, report, USB_DIR_OUT);
51 spin_unlock_irqrestore(&data->lock, flags); 52 spin_unlock_irqrestore(&data->lock, flags);
52 return 0; 53 return 0;
53} 54}