]> git.baikalelectronics.ru Git - kernel.git/commit
HID: input: optionally use device id in battery name
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 1 Aug 2017 22:38:02 +0000 (15:38 -0700)
committerJiri Kosina <jkosina@suse.cz>
Wed, 2 Aug 2017 08:51:46 +0000 (10:51 +0200)
commit68f3b1c96fac45141172a91080c4e7c3c5bcf085
tree64f2b42e97af73064833bdf16741af75a7211902
parenta0a85d8d4c6406a163f33932615bee0280731911
HID: input: optionally use device id in battery name

Manufacturers do not always populate serial number in their devices, so
let's fall back to device ID when forming the battery device name. As a
result, batteries in devices without serial number will be named like
this:

hid-0018:2D1F:510E.0001-battery

(as opposed to hid--battery for the first one, and failing to create
batteries for the subsequent ones).

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-input.c