Skip to content

Commit 77fe1fe

Browse files
Binary-EaterJiri Kosina
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 3ab196f commit 77fe1fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/hid/hid-nvidia-shield.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ static inline int thunderstrike_led_create(struct thunderstrike *ts)
798798
{
799799
struct led_classdev *led = &ts->led_dev;
800800

801-
led->name = "thunderstrike:blue:led";
801+
led->name = devm_kasprintf(&ts->base.hdev->dev, GFP_KERNEL,
802+
"thunderstrike%d:blue:led", ts->id);
802803
led->max_brightness = 1;
803804
led->flags = LED_CORE_SUSPENDRESUME;
804805
led->brightness_get = &thunderstrike_led_get_brightness;

0 commit comments

Comments
 (0)