Skip to content

Commit

Permalink
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/jikos/hid

* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: wiimote: fix invalid power_supply_powers call
  HID: wacom: Fix invalid power_supply_powers calls
  HID: hyperv: Properly disconnect the input device
  HID: usbhid: fix dead lock between open and disconect
  • Loading branch information
Linus Torvalds committed Feb 7, 2012
2 parents abaaf3e + 217c8b2 commit e25c173
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions drivers/hid/hid-hyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ static int mousevsc_remove(struct hv_device *dev)
struct mousevsc_dev *input_dev = hv_get_drvdata(dev);

vmbus_close(dev->channel);
hid_hw_stop(input_dev->hid_device);
hid_destroy_device(input_dev->hid_device);
mousevsc_free_device(input_dev);

Expand Down
7 changes: 4 additions & 3 deletions drivers/hid/hid-wacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ static int wacom_probe(struct hid_device *hdev,
wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
wdata->battery.use_for_apm = 0;

power_supply_powers(&wdata->battery, &hdev->dev);

ret = power_supply_register(&hdev->dev, &wdata->battery);
if (ret) {
Expand All @@ -540,21 +539,23 @@ static int wacom_probe(struct hid_device *hdev,
goto err_battery;
}

power_supply_powers(&wdata->battery, &hdev->dev);

wdata->ac.properties = wacom_ac_props;
wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props);
wdata->ac.get_property = wacom_ac_get_property;
wdata->ac.name = "wacom_ac";
wdata->ac.type = POWER_SUPPLY_TYPE_MAINS;
wdata->ac.use_for_apm = 0;

power_supply_powers(&wdata->battery, &hdev->dev);

ret = power_supply_register(&hdev->dev, &wdata->ac);
if (ret) {
hid_warn(hdev,
"can't create ac battery attribute, err: %d\n", ret);
goto err_ac;
}

power_supply_powers(&wdata->ac, &hdev->dev);
#endif
return 0;

Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/hid-wiimote-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,14 +1226,14 @@ static int wiimote_hid_probe(struct hid_device *hdev,
wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
wdata->battery.use_for_apm = 0;

power_supply_powers(&wdata->battery, &hdev->dev);

ret = power_supply_register(&wdata->hdev->dev, &wdata->battery);
if (ret) {
hid_err(hdev, "Cannot register battery device\n");
goto err_battery;
}

power_supply_powers(&wdata->battery, &hdev->dev);

ret = wiimote_leds_create(wdata);
if (ret)
goto err_free;
Expand Down
4 changes: 2 additions & 2 deletions drivers/hid/usbhid/hiddev.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,11 +922,11 @@ void hiddev_disconnect(struct hid_device *hid)
struct hiddev *hiddev = hid->hiddev;
struct usbhid_device *usbhid = hid->driver_data;

usb_deregister_dev(usbhid->intf, &hiddev_class);

mutex_lock(&hiddev->existancelock);
hiddev->exist = 0;

usb_deregister_dev(usbhid->intf, &hiddev_class);

if (hiddev->open) {
mutex_unlock(&hiddev->existancelock);
usbhid_close(hiddev->hid);
Expand Down

0 comments on commit e25c173

Please sign in to comment.