Skip to content

Commit 62bbe55

Browse files
author
Tzung-Bi Shih
committed
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 02b496a commit 62bbe55

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/platform/chrome/cros_kbd_led_backlight.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/init.h>
1010
#include <linux/kernel.h>
1111
#include <linux/leds.h>
12+
#include <linux/mod_devicetable.h>
1213
#include <linux/module.h>
1314
#include <linux/of.h>
1415
#include <linux/platform_data/cros_ec_commands.h>
@@ -247,17 +248,23 @@ static const struct of_device_id keyboard_led_of_match[] = {
247248
MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
248249
#endif
249250

251+
static const struct platform_device_id keyboard_led_id[] = {
252+
{ "cros-keyboard-leds", 0 },
253+
{}
254+
};
255+
MODULE_DEVICE_TABLE(platform, keyboard_led_id);
256+
250257
static struct platform_driver keyboard_led_driver = {
251258
.driver = {
252-
.name = "chromeos-keyboard-leds",
259+
.name = "cros-keyboard-leds",
253260
.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
254261
.of_match_table = of_match_ptr(keyboard_led_of_match),
255262
},
256263
.probe = keyboard_led_probe,
264+
.id_table = keyboard_led_id,
257265
};
258266
module_platform_driver(keyboard_led_driver);
259267

260268
MODULE_AUTHOR("Simon Que <[email protected]>");
261269
MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver");
262270
MODULE_LICENSE("GPL");
263-
MODULE_ALIAS("platform:chromeos-keyboard-leds");

0 commit comments

Comments
 (0)