* [PATCH] hwmon: sy7636a: add aliases
@ 2025-09-06 9:43 Andreas Kemnade
2025-09-06 13:28 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Kemnade @ 2025-09-06 9:43 UTC (permalink / raw)
To: jdelvare, linux, linux-hwmon, linux-kernel; +Cc: Andreas Kemnade
Add module aliases via module devicetable to have it autoloaded.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
index ed110884786b4..74ee0e756ffdc 100644
--- a/drivers/hwmon/sy7636a-hwmon.c
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -12,6 +12,7 @@
#include <linux/hwmon.h>
#include <linux/init.h>
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/regulator/machine.h>
@@ -94,11 +95,18 @@ static int sy7636a_sensor_probe(struct platform_device *pdev)
return 0;
}
+static const struct platform_device_id sy7636a_sensor_idtable[] = {
+ { "sy7636a-temperature" },
+ { },
+};
+MODULE_DEVICE_TABLE(platform, sy7636a_sensor_idtable);
+
static struct platform_driver sy7636a_sensor_driver = {
.probe = sy7636a_sensor_probe,
.driver = {
.name = "sy7636a-temperature",
},
+ .id_table = sy7636a_sensor_idtable,
};
module_platform_driver(sy7636a_sensor_driver);
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: sy7636a: add aliases
2025-09-06 9:43 [PATCH] hwmon: sy7636a: add aliases Andreas Kemnade
@ 2025-09-06 13:28 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2025-09-06 13:28 UTC (permalink / raw)
To: Andreas Kemnade, jdelvare, linux-hwmon, linux-kernel
On 9/6/25 02:43, Andreas Kemnade wrote:
> Add module aliases via module devicetable to have it autoloaded.
>
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
> drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
> index ed110884786b4..74ee0e756ffdc 100644
> --- a/drivers/hwmon/sy7636a-hwmon.c
> +++ b/drivers/hwmon/sy7636a-hwmon.c
> @@ -12,6 +12,7 @@
> #include <linux/hwmon.h>
> #include <linux/init.h>
> #include <linux/module.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/platform_device.h>
> #include <linux/regmap.h>
> #include <linux/regulator/machine.h>
> @@ -94,11 +95,18 @@ static int sy7636a_sensor_probe(struct platform_device *pdev)
> return 0;
> }
>
> +static const struct platform_device_id sy7636a_sensor_idtable[] = {
> + { "sy7636a-temperature" },
> + { },
> +};
> +MODULE_DEVICE_TABLE(platform, sy7636a_sensor_idtable);
> +
> static struct platform_driver sy7636a_sensor_driver = {
> .probe = sy7636a_sensor_probe,
> .driver = {
> .name = "sy7636a-temperature",
> },
> + .id_table = sy7636a_sensor_idtable,
> };
> module_platform_driver(sy7636a_sensor_driver);
>
I would suggest to just add
MODULE_ALIAS("platform:sy7636a-temperature");
instead.
Guenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-06 13:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-06 9:43 [PATCH] hwmon: sy7636a: add aliases Andreas Kemnade
2025-09-06 13:28 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®