From: Tzung-Bi Shih <tzungbi@kernel.org>
To: bleung@chromium.org, groeck@chromium.org,
linus.walleij@linaro.org, brgl@bgdev.pl,
hverkuil-cisco@xs4all.nl, mchehab@kernel.org, sre@kernel.org
Cc: tzungbi@kernel.org, chrome-platform@lists.linux.dev,
pmalani@chromium.org, linux-gpio@vger.kernel.org,
linux-media@vger.kernel.org, linux-pm@vger.kernel.org,
krzk@kernel.org
Subject: [PATCH v2 6/6] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match
Date: Mon, 1 Apr 2024 11:00:52 +0800 [thread overview]
Message-ID: <20240401030052.2887845-7-tzungbi@kernel.org> (raw)
In-Reply-To: <20240401030052.2887845-1-tzungbi@kernel.org>
Instead of using fallback driver name match, provide ID table[1] for the
primary match.
[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353
Reviewed-by: Benson Leung <bleung@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
Changes from v1 (https://patchwork.kernel.org/project/chrome-platform/patch/20240329075630.2069474-15-tzungbi@kernel.org/):
- Split from "platform/chrome: cros_kbd_led_backlight: provide ID table for
avoiding fallback match".
- Add R-b tags.
drivers/platform/chrome/cros_kbd_led_backlight.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_kbd_led_backlight.c b/drivers/platform/chrome/cros_kbd_led_backlight.c
index 814846a66e95..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,6 +248,12 @@ 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 = "cros-keyboard-leds",
@@ -254,10 +261,10 @@ static struct platform_driver keyboard_led_driver = {
.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:cros-keyboard-leds");
--
2.44.0.478.gd926399ef9-goog
next prev parent reply other threads:[~2024-04-01 3:01 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 3:00 [PATCH v2 0/6] provide ID table for avoiding fallback match Tzung-Bi Shih
2024-04-01 3:00 ` [PATCH v2 1/6] media: platform: cros-ec: " Tzung-Bi Shih
2024-04-08 7:36 ` Hans Verkuil
2024-04-01 3:00 ` [PATCH v2 2/6] gpio: " Tzung-Bi Shih
2024-04-02 8:58 ` Bartosz Golaszewski
2024-04-01 3:00 ` [PATCH v2 3/6] power: supply: cros_usbpd: " Tzung-Bi Shih
2024-04-01 3:00 ` [PATCH v2 4/6] power: supply: cros_pchg: " Tzung-Bi Shih
2024-04-01 3:00 ` [PATCH v2 5/6] platform/chrome: cros_kbd_led_backlight: shrink the driver name Tzung-Bi Shih
2024-04-01 10:02 ` Krzysztof Kozlowski
2024-04-01 10:19 ` Krzysztof Kozlowski
2024-04-01 10:42 ` Tzung-Bi Shih
2024-04-01 3:00 ` Tzung-Bi Shih [this message]
2024-04-01 10:03 ` [PATCH v2 6/6] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match Krzysztof Kozlowski
2024-04-01 9:45 ` (subset) [PATCH v2 0/6] " Sebastian Reichel
2024-05-27 2:55 ` patchwork-bot+chrome-platform
2024-05-27 3:07 ` patchwork-bot+chrome-platform
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240401030052.2887845-7-tzungbi@kernel.org \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=brgl@bgdev.pl \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=pmalani@chromium.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox