summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorRahul Rameshbabu <rrameshbabu@nvidia.com>2023-08-07 19:36:20 +0300
committerJiri Kosina <jkosina@suse.cz>2023-08-14 12:41:17 +0300
commit77fe1fed4741b14ccf5abf19dc794cc5928c1ac8 (patch)
tree9457c304e6382639ae27f9b34a29c7c4c77ada80 /drivers/hid
parent3ab196f882377ed5c2a946cf9f7ede8be4727f44 (diff)
downloadlinux-77fe1fed4741b14ccf5abf19dc794cc5928c1ac8.tar.xz
HID: nvidia-shield: Update Thunderstrike LED instance name to use id
Previously would let led_classdev handle renaming when name collision occurred. Now that an ID allocator is used to uniquely identify multiple Thunderstrike controllers, generate unique led device names. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-nvidia-shield.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c
index 1612de3ef4c5..43784bb57d3f 100644
--- a/drivers/hid/hid-nvidia-shield.c
+++ b/drivers/hid/hid-nvidia-shield.c
@@ -798,7 +798,8 @@ static inline int thunderstrike_led_create(struct thunderstrike *ts)
{
struct led_classdev *led = &ts->led_dev;
- led->name = "thunderstrike:blue:led";
+ led->name = devm_kasprintf(&ts->base.hdev->dev, GFP_KERNEL,
+ "thunderstrike%d:blue:led", ts->id);
led->max_brightness = 1;
led->flags = LED_CORE_SUSPENDRESUME;
led->brightness_get = &thunderstrike_led_get_brightness;