diff options
author | Frank Praznik <frank.praznik@oh.rr.com> | 2014-04-14 10:11:34 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2014-04-24 18:53:12 +0200 |
commit | 314531f18de0063131567c535af0cec3e4969c24 (patch) | |
tree | 6f5e15faf3625713a6d4fb59be51663ce28666f4 /drivers/hid | |
parent | fa57a8107b2c861411d385394e0830a656a91a8f (diff) |
HID: sony: Use the controller Bluetooth MAC address as the unique value in the battery name string
Use the controller Bluetooth MAC address as the unique identifier in the
battery name string instead of the atomic integer that was used before.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sony.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 8973f087a1a..6ce2e3ab069 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -1413,8 +1413,6 @@ static int sony_battery_get_property(struct power_supply *psy, static int sony_battery_probe(struct sony_sc *sc) { - static atomic_t power_id_seq = ATOMIC_INIT(0); - unsigned long power_id; struct hid_device *hdev = sc->hdev; int ret; @@ -1424,15 +1422,13 @@ static int sony_battery_probe(struct sony_sc *sc) */ sc->battery_capacity = 100; - power_id = (unsigned long)atomic_inc_return(&power_id_seq); - sc->battery.properties = sony_battery_props; sc->battery.num_properties = ARRAY_SIZE(sony_battery_props); sc->battery.get_property = sony_battery_get_property; sc->battery.type = POWER_SUPPLY_TYPE_BATTERY; sc->battery.use_for_apm = 0; - sc->battery.name = kasprintf(GFP_KERNEL, "sony_controller_battery_%lu", - power_id); + sc->battery.name = kasprintf(GFP_KERNEL, "sony_controller_battery_%pMR", + sc->mac_address); if (!sc->battery.name) return -ENOMEM; |