Input: wacom - register power device at the HID level
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>
Thu, 24 Jul 2014 20:01:40 +0000 (13:01 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 26 Jul 2014 01:53:53 +0000 (18:53 -0700)
Use the HID device as the parent for the power device when dealing with
a wireless receiver.
Removes one more usb dependency and does not break user space.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Jason Gerecke <killertofu@gmail.com>
Tested-by: Jason Gerecke <killertofu@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/tablet/wacom_sys.c

index 8065bac5fcb332e6dc93f7cd8747d37cd8996c41..b8710594185a3ae5701dd323c8815731711a672c 100644 (file)
@@ -966,12 +966,12 @@ static int wacom_initialize_battery(struct wacom *wacom)
                wacom->battery.type = POWER_SUPPLY_TYPE_BATTERY;
                wacom->battery.use_for_apm = 0;
 
-               error = power_supply_register(&wacom->usbdev->dev,
+               error = power_supply_register(&wacom->hdev->dev,
                                              &wacom->battery);
 
                if (!error)
                        power_supply_powers(&wacom->battery,
-                                           &wacom->usbdev->dev);
+                                           &wacom->hdev->dev);
        }
 
        return error;