diff mbox series

[03/18] rtc: cros-ec: provide ID table for avoiding fallback match

Message ID 20240329075630.2069474-4-tzungbi@kernel.org
State Accepted
Headers show
Series platform/chrome: provide ID table for avoiding fallback match | expand

Commit Message

Tzung-Bi Shih March 29, 2024, 7:56 a.m. UTC
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/rtc/rtc-cros-ec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski March 29, 2024, 12:15 p.m. UTC | #1
On 29/03/2024 08:56, Tzung-Bi Shih wrote:
> 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>

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Alexandre Belloni March 29, 2024, 3 p.m. UTC | #2
On Fri, 29 Mar 2024 15:56:15 +0800, Tzung-Bi Shih wrote:
> 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
> 
> 

Applied, thanks!

[03/18] rtc: cros-ec: provide ID table for avoiding fallback match
        https://git.kernel.org/abelloni/c/61c86d14745d

Best regards,
Benson Leung March 29, 2024, 8:07 p.m. UTC | #3
On Fri, Mar 29, 2024 at 03:56:15PM +0800, Tzung-Bi Shih wrote:
> 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>

Reviewed-by: Benson Leung <bleung@chromium.org>


> ---
>  drivers/rtc/rtc-cros-ec.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-cros-ec.c b/drivers/rtc/rtc-cros-ec.c
> index 0cd397c04ff0..f57462c7b2c6 100644
> --- a/drivers/rtc/rtc-cros-ec.c
> +++ b/drivers/rtc/rtc-cros-ec.c
> @@ -5,6 +5,7 @@
>  // Author: Stephen Barber <smbarber@chromium.org>
>  
>  #include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>
>  #include <linux/module.h>
>  #include <linux/platform_data/cros_ec_commands.h>
>  #include <linux/platform_data/cros_ec_proto.h>
> @@ -392,6 +393,12 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
>  		dev_err(dev, "failed to unregister notifier\n");
>  }
>  
> +static const struct platform_device_id cros_ec_rtc_id[] = {
> +	{ DRV_NAME, 0 },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
> +
>  static struct platform_driver cros_ec_rtc_driver = {
>  	.probe = cros_ec_rtc_probe,
>  	.remove_new = cros_ec_rtc_remove,
> @@ -399,6 +406,7 @@ static struct platform_driver cros_ec_rtc_driver = {
>  		.name = DRV_NAME,
>  		.pm = &cros_ec_rtc_pm_ops,
>  	},
> +	.id_table = cros_ec_rtc_id,
>  };
>  
>  module_platform_driver(cros_ec_rtc_driver);
> @@ -406,4 +414,3 @@ module_platform_driver(cros_ec_rtc_driver);
>  MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
>  MODULE_AUTHOR("Stephen Barber <smbarber@chromium.org>");
>  MODULE_LICENSE("GPL v2");
> -MODULE_ALIAS("platform:" DRV_NAME);
> -- 
> 2.44.0.478.gd926399ef9-goog
> 
>
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-cros-ec.c b/drivers/rtc/rtc-cros-ec.c
index 0cd397c04ff0..f57462c7b2c6 100644
--- a/drivers/rtc/rtc-cros-ec.c
+++ b/drivers/rtc/rtc-cros-ec.c
@@ -5,6 +5,7 @@ 
 // Author: Stephen Barber <smbarber@chromium.org>
 
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -392,6 +393,12 @@  static void cros_ec_rtc_remove(struct platform_device *pdev)
 		dev_err(dev, "failed to unregister notifier\n");
 }
 
+static const struct platform_device_id cros_ec_rtc_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
+
 static struct platform_driver cros_ec_rtc_driver = {
 	.probe = cros_ec_rtc_probe,
 	.remove_new = cros_ec_rtc_remove,
@@ -399,6 +406,7 @@  static struct platform_driver cros_ec_rtc_driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_rtc_pm_ops,
 	},
+	.id_table = cros_ec_rtc_id,
 };
 
 module_platform_driver(cros_ec_rtc_driver);
@@ -406,4 +414,3 @@  module_platform_driver(cros_ec_rtc_driver);
 MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
 MODULE_AUTHOR("Stephen Barber <smbarber@chromium.org>");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:" DRV_NAME);