]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hwmon: Move MODULE_DEVICE_TABLE next to the table itself
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Tue, 5 May 2026 10:29:22 +0000 (12:29 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 9 Jun 2026 15:22:57 +0000 (08:22 -0700)
By convention MODULE_DEVICE_TABLE() immediately follows the ID table it
exports, because this is easier to read and verify.  It also makes more
sense since #ifdef for ACPI or OF could hide both of them.

Most of the privers already have this correctly placed, so adjust
the missing ones.  No functional impact.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Acked-by: Thomas Weißschuh <linux@weissschuh.net> # cros_ec_hwmon.c
Link: https://lore.kernel.org/r/20260505102923.189289-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/applesmc.c
drivers/hwmon/cros_ec_hwmon.c
drivers/hwmon/intel-m10-bmc-hwmon.c
drivers/hwmon/nsa320-hwmon.c

index 24f3e86d0ebf2b08ec033a83eb26aef333e9df7c..90a14a7f2c4c0cee00b4a8f945e71aab56fe7fe1 100644 (file)
@@ -1305,6 +1305,7 @@ static const struct dmi_system_id applesmc_whitelist[] __initconst = {
        },
        { .ident = NULL }
 };
+MODULE_DEVICE_TABLE(dmi, applesmc_whitelist);
 
 static int __init applesmc_init(void)
 {
@@ -1416,4 +1417,3 @@ module_exit(applesmc_exit);
 MODULE_AUTHOR("Nicolas Boichat");
 MODULE_DESCRIPTION("Apple SMC");
 MODULE_LICENSE("GPL v2");
-MODULE_DEVICE_TABLE(dmi, applesmc_whitelist);
index 6cf5ab0f4b738027972657ec5c80cb487eb28b64..7c308b0a4b9e2c8de197108a25371fb5090a60f9 100644 (file)
@@ -657,6 +657,7 @@ static const struct platform_device_id cros_ec_hwmon_id[] = {
        { DRV_NAME, 0 },
        {}
 };
+MODULE_DEVICE_TABLE(platform, cros_ec_hwmon_id);
 
 static struct platform_driver cros_ec_hwmon_driver = {
        .driver.name    = DRV_NAME,
@@ -667,7 +668,6 @@ static struct platform_driver cros_ec_hwmon_driver = {
 };
 module_platform_driver(cros_ec_hwmon_driver);
 
-MODULE_DEVICE_TABLE(platform, cros_ec_hwmon_id);
 MODULE_DESCRIPTION("ChromeOS EC Hardware Monitoring Driver");
 MODULE_AUTHOR("Thomas Weißschuh <linux@weissschuh.net");
 MODULE_LICENSE("GPL");
index aa01a4bedc21b518616e2ca2574a17a1fb209e48..e85d42a4511358f7e561adbbb121014e5d99b721 100644 (file)
@@ -773,6 +773,7 @@ static const struct platform_device_id intel_m10bmc_hwmon_ids[] = {
        },
        { }
 };
+MODULE_DEVICE_TABLE(platform, intel_m10bmc_hwmon_ids);
 
 static struct platform_driver intel_m10bmc_hwmon_driver = {
        .probe = m10bmc_hwmon_probe,
@@ -783,7 +784,6 @@ static struct platform_driver intel_m10bmc_hwmon_driver = {
 };
 module_platform_driver(intel_m10bmc_hwmon_driver);
 
-MODULE_DEVICE_TABLE(platform, intel_m10bmc_hwmon_ids);
 MODULE_AUTHOR("Intel Corporation");
 MODULE_DESCRIPTION("Intel MAX 10 BMC hardware monitor");
 MODULE_LICENSE("GPL");
index 18076ba7fc1472aaa6e1091226eb8ff7ef0fda5e..5c99acc09677698c07c7a6b565b1b3921b64b695 100644 (file)
@@ -153,6 +153,7 @@ static const struct of_device_id of_nsa320_hwmon_match[] = {
        { .compatible = "zyxel,nsa320-mcu", },
        { },
 };
+MODULE_DEVICE_TABLE(of, of_nsa320_hwmon_match);
 
 static int nsa320_hwmon_probe(struct platform_device *pdev)
 {
@@ -197,7 +198,6 @@ static struct platform_driver nsa320_hwmon_driver = {
 
 module_platform_driver(nsa320_hwmon_driver);
 
-MODULE_DEVICE_TABLE(of, of_nsa320_hwmon_match);
 MODULE_AUTHOR("Peter Schildmann <linux@schildmann.info>");
 MODULE_AUTHOR("Adam Baker <linux@baker-net.org.uk>");
 MODULE_DESCRIPTION("NSA320 Hardware Monitoring");