Re: [PATCH 1/7] HID: wiimote: Simplify synchronization
From: Oliver Neukum <oliver@neukum.org>
Date: 2011-08-14 10:52:32
From: Oliver Neukum <oliver@neukum.org>
Date: 2011-08-14 10:52:32
Am Samstag, 13. August 2011, 15:29:09 schrieb David Herrmann:
@@ -362,6 +343,15 @@ static struct wiimote_data *wiimote_create(struct hid_device *hdev) static void wiimote_destroy(struct wiimote_data *wdata) { + device_remove_file(&wdata->hdev->dev, &dev_attr_led1); + device_remove_file(&wdata->hdev->dev, &dev_attr_led2); + device_remove_file(&wdata->hdev->dev, &dev_attr_led3); + device_remove_file(&wdata->hdev->dev, &dev_attr_led4); + + input_unregister_device(wdata->input); + hid_hw_stop(wdata->hdev); + + cancel_work_sync(&wdata->worker); kfree(wdata); }
This looks like the work can run on a device whose hardware has already been stopped. Is this safe? Regards Oliver