Skip to content

Commit 8b30fb4

Browse files
Icenowybentiss
authored andcommitted
HID: nintendo: deregister home LED when it fails
Some Pro Controller compatible controllers do not support home LED, and will fail when setting it. Currently this leads to probe failure. Change the code that fails probing to deregistering home LED. Signed-off-by: Icenowy Zheng <[email protected]> Reviewed-by: Daniel J. Ogorchock <[email protected]> Reviewed-by: Silvan Jegen <[email protected]> [bentiss: changed "dflt" to "default"] Signed-off-by: Benjamin Tissoires <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a1f7642 commit 8b30fb4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,9 +1904,8 @@ static int joycon_leds_create(struct joycon_ctlr *ctlr)
19041904
/* Set the home LED to 0 as default state */
19051905
ret = joycon_home_led_brightness_set(led, 0);
19061906
if (ret) {
1907-
hid_err(hdev, "Failed to set home LED dflt; ret=%d\n",
1908-
ret);
1909-
return ret;
1907+
hid_warn(hdev, "Failed to set home LED default, unregistering home LED");
1908+
devm_led_classdev_unregister(&hdev->dev, led);
19101909
}
19111910
}
19121911

0 commit comments

Comments
 (0)