Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263674
b: refs/heads/master
c: dde58cf
h: refs/heads/master
v: v3
  • Loading branch information
David Herrmann authored and Jiri Kosina committed Sep 7, 2011
1 parent 1a04b7d commit 9ad8477
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d1db0777981e1626ae71243984ac300b61789ff
refs/heads/master: dde58cfcc3b6dd2f160ffd355f76ae526155a4df
21 changes: 9 additions & 12 deletions trunk/drivers/hid/hid-wacom.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,7 @@ static int wacom_probe(struct hid_device *hdev,
if (ret) {
hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n",
ret);
/*
* battery attribute is not critical for the tablet, but if it
* failed then there is no need to create ac attribute
*/
goto move_on;
goto err_battery;
}

wdata->ac.properties = wacom_ac_props;
Expand All @@ -371,14 +367,8 @@ static int wacom_probe(struct hid_device *hdev,
if (ret) {
hid_warn(hdev,
"can't create ac battery attribute, err: %d\n", ret);
/*
* ac attribute is not critical for the tablet, but if it
* failed then we don't want to battery attribute to exist
*/
power_supply_unregister(&wdata->battery);
goto err_ac;
}

move_on:
#endif
hidinput = list_entry(hdev->inputs.next, struct hid_input, list);
input = hidinput->input;
Expand Down Expand Up @@ -416,6 +406,13 @@ static int wacom_probe(struct hid_device *hdev,

return 0;

#ifdef CONFIG_HID_WACOM_POWER_SUPPLY
err_ac:
power_supply_unregister(&wdata->battery);
err_battery:
device_remove_file(&hdev->dev, &dev_attr_speed);
hid_hw_stop(hdev);
#endif
err_free:
kfree(wdata);
return ret;
Expand Down

0 comments on commit 9ad8477

Please sign in to comment.