summaryrefslogtreecommitdiff
path: root/drivers/platform/chrome/cros_kbd_led_backlight.c
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2024-03-29 10:56:26 +0300
committerTzung-Bi Shih <tzungbi@kernel.org>2024-04-24 11:45:58 +0300
commit62bbe5556510e734215a880dad748192f962c150 (patch)
treed0ba9b2ee7455df10c459c9f5c0553d00d8895bf /drivers/platform/chrome/cros_kbd_led_backlight.c
parent02b496aa01d9447c50f8d26b0af48f664f9908a6 (diff)
downloadlinux-62bbe5556510e734215a880dad748192f962c150.tar.xz
platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match
Instead of using fallback driver name match, provide ID table[1] for the primary match. Also shrink the name for fitting to [2]. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 [2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608 Reviewed-by: Benson Leung <bleung@chromium.org> Link: https://lore.kernel.org/r/20240329075630.2069474-15-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/platform/chrome/cros_kbd_led_backlight.c')
-rw-r--r--drivers/platform/chrome/cros_kbd_led_backlight.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c
index 793fd3f1015d..b83e4f328620 100644
--- a/drivers/platform/chrome/cros_kbd_led_backlight.c
+++ b/drivers/platform/chrome/cros_kbd_led_backlight.c
@@ -9,6 +9,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/cros_ec_commands.h>
@@ -247,17 +248,23 @@ static const struct of_device_id keyboard_led_of_match[] = {
MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
#endif
+static const struct platform_device_id keyboard_led_id[] = {
+ { "cros-keyboard-leds", 0 },
+ {}
+};
+MODULE_DEVICE_TABLE(platform, keyboard_led_id);
+
static struct platform_driver keyboard_led_driver = {
.driver = {
- .name = "chromeos-keyboard-leds",
+ .name = "cros-keyboard-leds",
.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
.of_match_table = of_match_ptr(keyboard_led_of_match),
},
.probe = keyboard_led_probe,
+ .id_table = keyboard_led_id,
};
module_platform_driver(keyboard_led_driver);
MODULE_AUTHOR("Simon Que <sque@chromium.org>");
MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:chromeos-keyboard-leds");