Skip to content

Commit

Permalink
HID: nvidia-shield: Update Thunderstrike LED instance name to use id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rahul Rameshbabu authored and Jiri Kosina committed Aug 14, 2023
1 parent 3ab196f commit 77fe1fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-nvidia-shield.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 77fe1fe

Please sign in to comment.