aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-wacom.c
diff options
context:
space:
mode:
authorPrzemo Firszt <przemo@firszt.eu>2012-02-05 17:35:24 -0500
committerJiri Kosina <jkosina@suse.cz>2012-02-06 10:14:20 -0500
commitd7cb3dbd10c09081fafd05fcbef590ce04e402ff (patch)
tree025f3d9d9a0dfdd609a82719e7c6fcb517a225a5 /drivers/hid/hid-wacom.c
parentd4730ace0c7dbb64513e35b6fc5fd7e7f381e490 (diff)
HID: wacom: Fix invalid power_supply_powers calls
power_supply_powers calls added in 35b4c01e2 ("power_supply: add "powers" links to self-powered HID devices") have to be called after power device is created. This patch also fixes the second call - it has to be "ac" instead of "battery" Signed-off-by: Przemo Firszt <przemo@firszt.eu> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-rw-r--r--drivers/hid/hid-wacom.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index b47e58b52d9f..acab74cde727 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -531,7 +531,6 @@ static int wacom_probe(struct hid_device *hdev,
531 wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY; 531 wdata->battery.type = POWER_SUPPLY_TYPE_BATTERY;
532 wdata->battery.use_for_apm = 0; 532 wdata->battery.use_for_apm = 0;
533 533
534 power_supply_powers(&wdata->battery, &hdev->dev);
535 534
536 ret = power_supply_register(&hdev->dev, &wdata->battery); 535 ret = power_supply_register(&hdev->dev, &wdata->battery);
537 if (ret) { 536 if (ret) {
@@ -540,6 +539,8 @@ static int wacom_probe(struct hid_device *hdev,
540 goto err_battery; 539 goto err_battery;
541 } 540 }
542 541
542 power_supply_powers(&wdata->battery, &hdev->dev);
543
543 wdata->ac.properties = wacom_ac_props; 544 wdata->ac.properties = wacom_ac_props;
544 wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props); 545 wdata->ac.num_properties = ARRAY_SIZE(wacom_ac_props);
545 wdata->ac.get_property = wacom_ac_get_property; 546 wdata->ac.get_property = wacom_ac_get_property;
@@ -547,14 +548,14 @@ static int wacom_probe(struct hid_device *hdev,
547 wdata->ac.type = POWER_SUPPLY_TYPE_MAINS; 548 wdata->ac.type = POWER_SUPPLY_TYPE_MAINS;
548 wdata->ac.use_for_apm = 0; 549 wdata->ac.use_for_apm = 0;
549 550
550 power_supply_powers(&wdata->battery, &hdev->dev);
551
552 ret = power_supply_register(&hdev->dev, &wdata->ac); 551 ret = power_supply_register(&hdev->dev, &wdata->ac);
553 if (ret) { 552 if (ret) {
554 hid_warn(hdev, 553 hid_warn(hdev,
555 "can't create ac battery attribute, err: %d\n", ret); 554 "can't create ac battery attribute, err: %d\n", ret);
556 goto err_ac; 555 goto err_ac;
557 } 556 }
557
558 power_supply_powers(&wdata->ac, &hdev->dev);
558#endif 559#endif
559 return 0; 560 return 0;
560 561