aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-thingm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-thingm.c')
-rw-r--r--drivers/hid/hid-thingm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/hid/hid-thingm.c b/drivers/hid/hid-thingm.c
index 134be89b15ea..b95d3978c272 100644
--- a/drivers/hid/hid-thingm.c
+++ b/drivers/hid/hid-thingm.c
@@ -208,10 +208,10 @@ unregister_red:
208 208
209static void thingm_remove_rgb(struct thingm_rgb *rgb) 209static void thingm_remove_rgb(struct thingm_rgb *rgb)
210{ 210{
211 flush_work(&rgb->work);
212 led_classdev_unregister(&rgb->red.ldev); 211 led_classdev_unregister(&rgb->red.ldev);
213 led_classdev_unregister(&rgb->green.ldev); 212 led_classdev_unregister(&rgb->green.ldev);
214 led_classdev_unregister(&rgb->blue.ldev); 213 led_classdev_unregister(&rgb->blue.ldev);
214 flush_work(&rgb->work);
215} 215}
216 216
217static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id) 217static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id)
@@ -250,6 +250,7 @@ static int thingm_probe(struct hid_device *hdev, const struct hid_device_id *id)
250 250
251 if (!tdev->fwinfo) { 251 if (!tdev->fwinfo) {
252 hid_err(hdev, "unsupported firmware %c\n", tdev->version.major); 252 hid_err(hdev, "unsupported firmware %c\n", tdev->version.major);
253 err = -ENODEV;
253 goto stop; 254 goto stop;
254 } 255 }
255 256
@@ -286,10 +287,10 @@ static void thingm_remove(struct hid_device *hdev)
286 struct thingm_device *tdev = hid_get_drvdata(hdev); 287 struct thingm_device *tdev = hid_get_drvdata(hdev);
287 int i; 288 int i;
288 289
290 hid_hw_stop(hdev);
291
289 for (i = 0; i < tdev->fwinfo->numrgb; ++i) 292 for (i = 0; i < tdev->fwinfo->numrgb; ++i)
290 thingm_remove_rgb(tdev->rgb + i); 293 thingm_remove_rgb(tdev->rgb + i);
291
292 hid_hw_stop(hdev);
293} 294}
294 295
295static const struct hid_device_id thingm_table[] = { 296static const struct hid_device_id thingm_table[] = {