All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
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,
	alexandre.belloni@bootlin.com
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,
	linux-rtc@vger.kernel.org, krzk@kernel.org
Subject: [PATCH 15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match
Date: Fri, 29 Mar 2024 15:56:27 +0800	[thread overview]
Message-ID: <20240329075630.2069474-16-tzungbi@kernel.org> (raw)
In-Reply-To: <20240329075630.2069474-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

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
 drivers/platform/chrome/wilco_ec/telemetry.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/wilco_ec/telemetry.c b/drivers/platform/chrome/wilco_ec/telemetry.c
index b7c616f3d179..21d4cbbb009a 100644
--- a/drivers/platform/chrome/wilco_ec/telemetry.c
+++ b/drivers/platform/chrome/wilco_ec/telemetry.c
@@ -30,6 +30,7 @@
 #include <linux/cdev.h>
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -409,12 +410,19 @@ static void telem_device_remove(struct platform_device *pdev)
 	put_device(&dev_data->dev);
 }
 
+static const struct platform_device_id telem_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, telem_id);
+
 static struct platform_driver telem_driver = {
 	.probe = telem_device_probe,
 	.remove_new = telem_device_remove,
 	.driver = {
 		.name = DRV_NAME,
 	},
+	.id_table = telem_id,
 };
 
 static int __init telem_module_init(void)
@@ -466,4 +474,3 @@ module_exit(telem_module_exit);
 MODULE_AUTHOR("Nick Crews <ncrews@chromium.org>");
 MODULE_DESCRIPTION("Wilco EC telemetry driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
-- 
2.44.0.478.gd926399ef9-goog


  parent reply	other threads:[~2024-03-29  7:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29  7:56 [PATCH 00/18] platform/chrome: provide ID table for avoiding fallback match Tzung-Bi Shih
2024-03-29  7:56 ` [PATCH 01/18] media: platform: cros-ec: " Tzung-Bi Shih
2024-03-29 12:15   ` Krzysztof Kozlowski
2024-03-29 20:05   ` Benson Leung
2024-03-29  7:56 ` [PATCH 02/18] gpio: " Tzung-Bi Shih
2024-03-29 12:15   ` Krzysztof Kozlowski
2024-03-29 20:06   ` Benson Leung
2024-04-04 11:32   ` Linus Walleij
2024-03-29  7:56 ` [PATCH 03/18] rtc: " Tzung-Bi Shih
2024-03-29 12:15   ` Krzysztof Kozlowski
2024-03-29 15:00   ` (subset) " Alexandre Belloni
2024-03-29 20:07   ` Benson Leung
2024-03-29  7:56 ` [PATCH 04/18] platform/chrome: cros_ec_sensorhub: " Tzung-Bi Shih
2024-03-29 12:16   ` Krzysztof Kozlowski
2024-03-29 20:08   ` Benson Leung
2024-03-29  7:56 ` [PATCH 05/18] power: supply: cros_usbpd: " Tzung-Bi Shih
2024-03-29 12:18   ` Krzysztof Kozlowski
2024-03-29 20:09   ` Benson Leung
2024-03-29 23:03   ` Prashant Malani
2024-03-29  7:56 ` [PATCH 06/18] platform/chrome: cros_usbpd_logger: " Tzung-Bi Shih
2024-03-29 15:50   ` Krzysztof Kozlowski
2024-03-29 20:11   ` Benson Leung
2024-03-29  7:56 ` [PATCH 07/18] platform/chrome: cros_usbpd_notify: " Tzung-Bi Shih
2024-03-29 15:50   ` Krzysztof Kozlowski
2024-03-29 20:13   ` Benson Leung
2024-03-29 22:06   ` Prashant Malani
2024-03-29  7:56 ` [PATCH 08/18] platform/chrome: cros_ec_chardev: " Tzung-Bi Shih
2024-03-29 15:50   ` Krzysztof Kozlowski
2024-03-29 20:13   ` Benson Leung
2024-03-29  7:56 ` [PATCH 09/18] platform/chrome: cros_ec_debugfs: " Tzung-Bi Shih
2024-03-29 15:51   ` Krzysztof Kozlowski
2024-03-29 20:14   ` Benson Leung
2024-03-29  7:56 ` [PATCH 10/18] platform/chrome: cros_ec_sysfs: " Tzung-Bi Shih
2024-03-29 12:37   ` Krzysztof Kozlowski
2024-03-29 20:15   ` Benson Leung
2024-03-29  7:56 ` [PATCH 11/18] power: supply: cros_pchg: " Tzung-Bi Shih
2024-03-29 15:50   ` Krzysztof Kozlowski
2024-03-29 20:16   ` Benson Leung
2024-03-29  7:56 ` [PATCH 12/18] platform/chrome: cros_ec_lightbar: " Tzung-Bi Shih
2024-03-29 15:51   ` Krzysztof Kozlowski
2024-03-29 20:18   ` Benson Leung
2024-03-29  7:56 ` [PATCH 13/18] platform/chrome: cros_ec_vbc: " Tzung-Bi Shih
2024-03-29 15:55   ` Krzysztof Kozlowski
2024-03-29 20:19   ` Benson Leung
2024-03-29  7:56 ` [PATCH 14/18] platform/chrome: cros_kbd_led_backlight: " Tzung-Bi Shih
2024-03-29 15:53   ` Krzysztof Kozlowski
2024-04-01  3:11     ` Tzung-Bi Shih
2024-03-29 20:20   ` Benson Leung
2024-03-29  7:56 ` Tzung-Bi Shih [this message]
2024-03-29 15:52   ` [PATCH 15/18] platform/chrome: wilco_ec: telemetry: " Krzysztof Kozlowski
2024-03-29 20:21   ` Benson Leung
2024-03-29  7:56 ` [PATCH 16/18] platform/chrome: wilco_ec: debugfs: " Tzung-Bi Shih
2024-03-29 15:52   ` Krzysztof Kozlowski
2024-03-29 20:21   ` Benson Leung
2024-03-29  7:56 ` [PATCH 17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS Tzung-Bi Shih
2024-03-29 15:55   ` Krzysztof Kozlowski
2024-03-29 20:22   ` Benson Leung
2024-03-29  7:56 ` [PATCH 18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match Tzung-Bi Shih
2024-03-29 15:51   ` Krzysztof Kozlowski
2024-03-29 20:23   ` Benson Leung
2024-04-01  2:30 ` [PATCH 00/18] platform/chrome: " patchwork-bot+chrome-platform
2024-04-01  2:30 ` patchwork-bot+chrome-platform
2024-04-03  7:20 ` patchwork-bot+chrome-platform
2024-04-03  7:20 ` 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=20240329075630.2069474-16-tzungbi@kernel.org \
    --to=tzungbi@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --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=linux-rtc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.