aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorMichael Poole <mdpoole@troilus.org>2010-03-09 06:47:35 -0500
committerJiri Kosina <jkosina@suse.cz>2010-03-09 07:42:19 -0500
commit28918c211d86b6eeb70182c523800c7bc442960c (patch)
tree02a27440adfd5ad3751e58a8d8b2202aec178da4 /drivers/hid
parenta85821fce2c100a6680511f9693b76f9717fbdee (diff)
HID: magicmouse: fix oops after device removal
Ask the HID core not to register an input device for the mouse. Fix an oops after removing the device, due to leaving the new input device registered. Signed-off-by: Michael Poole <mdpoole@troilus.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-magicmouse.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 4a3a94f2b10c..c174b64c3810 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -353,7 +353,7 @@ static int magicmouse_probe(struct hid_device *hdev,
353 goto err_free; 353 goto err_free;
354 } 354 }
355 355
356 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); 356 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT & ~HID_CONNECT_HIDINPUT);
357 if (ret) { 357 if (ret) {
358 dev_err(&hdev->dev, "magicmouse hw start failed\n"); 358 dev_err(&hdev->dev, "magicmouse hw start failed\n");
359 goto err_free; 359 goto err_free;
@@ -409,8 +409,11 @@ err_free:
409 409
410static void magicmouse_remove(struct hid_device *hdev) 410static void magicmouse_remove(struct hid_device *hdev)
411{ 411{
412 struct magicmouse_sc *msc = hid_get_drvdata(hdev);
413
412 hid_hw_stop(hdev); 414 hid_hw_stop(hdev);
413 kfree(hid_get_drvdata(hdev)); 415 input_unregister_device(msc->input);
416 kfree(msc);
414} 417}
415 418
416static const struct hid_device_id magic_mice[] = { 419static const struct hid_device_id magic_mice[] = {