From: Rahul Rameshbabu Date: Mon, 7 Aug 2023 16:36:20 +0000 (-0700) Subject: HID: nvidia-shield: Update Thunderstrike LED instance name to use id X-Git-Tag: v6.6-rc1~96^2~6^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77fe1fed4741b14ccf5abf19dc794cc5928c1ac8;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index 1612de3ef4c58..43784bb57d3fb 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;