aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2011-05-25 14:43:33 -0400
committerJean Delvare <khali@endymion.delvare>2011-05-25 14:43:33 -0400
commitec693fe5287e1791f4d206e81ebdfdc7d1f8f6b9 (patch)
tree6f261c6f8a23fdd604f6a7b2f31cac906b0533ea /drivers/hwmon
parent5b0380c94a2e888b7858fbec6fc3ac623bc9b05a (diff)
hwmon: (abituguru) Depend on DMI
The abituguru drivers are only built on X86, where DMI support is now enabled by default. So let these drivers depend on DMI, for the following gains: * Robustness and safety. Detection of these devices is weak and uses non-standard methods, it should really be limited to Abit boards unless the user explicitly asks otherwise. * Code simplicity. The code is easier to read without ifdefs. * Better build testing coverage. Now there's only one way to build the drivers, so no risk of build failure on exotic systems. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Alistair John Strachan <alistair@devzero.co.uk> Acked-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/Kconfig4
-rw-r--r--drivers/hwmon/abituguru.c3
-rw-r--r--drivers/hwmon/abituguru3.c13
3 files changed, 2 insertions, 18 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 12bfc073fc54..900409615ae9 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -41,7 +41,7 @@ comment "Native drivers"
41 41
42config SENSORS_ABITUGURU 42config SENSORS_ABITUGURU
43 tristate "Abit uGuru (rev 1 & 2)" 43 tristate "Abit uGuru (rev 1 & 2)"
44 depends on X86 && EXPERIMENTAL 44 depends on X86 && DMI && EXPERIMENTAL
45 help 45 help
46 If you say yes here you get support for the sensor part of the first 46 If you say yes here you get support for the sensor part of the first
47 and second revision of the Abit uGuru chip. The voltage and frequency 47 and second revision of the Abit uGuru chip. The voltage and frequency
@@ -56,7 +56,7 @@ config SENSORS_ABITUGURU
56 56
57config SENSORS_ABITUGURU3 57config SENSORS_ABITUGURU3
58 tristate "Abit uGuru (rev 3)" 58 tristate "Abit uGuru (rev 3)"
59 depends on X86 && EXPERIMENTAL 59 depends on X86 && DMI && EXPERIMENTAL
60 help 60 help
61 If you say yes here you get support for the sensor part of the 61 If you say yes here you get support for the sensor part of the
62 third revision of the Abit uGuru chip. Only reading the sensors 62 third revision of the Abit uGuru chip. Only reading the sensors
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c
index e7d4c4687f02..65a35cf5b3c5 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -1448,15 +1448,12 @@ static int __init abituguru_init(void)
1448{ 1448{
1449 int address, err; 1449 int address, err;
1450 struct resource res = { .flags = IORESOURCE_IO }; 1450 struct resource res = { .flags = IORESOURCE_IO };
1451
1452#ifdef CONFIG_DMI
1453 const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); 1451 const char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
1454 1452
1455 /* safety check, refuse to load on non Abit motherboards */ 1453 /* safety check, refuse to load on non Abit motherboards */
1456 if (!force && (!board_vendor || 1454 if (!force && (!board_vendor ||
1457 strcmp(board_vendor, "http://www.abit.com.tw/"))) 1455 strcmp(board_vendor, "http://www.abit.com.tw/")))
1458 return -ENODEV; 1456 return -ENODEV;
1459#endif
1460 1457
1461 address = abituguru_detect(); 1458 address = abituguru_detect();
1462 if (address < 0) 1459 if (address < 0)
diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
index e89d572e3320..d30855a75786 100644
--- a/drivers/hwmon/abituguru3.c
+++ b/drivers/hwmon/abituguru3.c
@@ -1119,8 +1119,6 @@ static struct platform_driver abituguru3_driver = {
1119 .resume = abituguru3_resume 1119 .resume = abituguru3_resume
1120}; 1120};
1121 1121
1122#ifdef CONFIG_DMI
1123
1124static int __init abituguru3_dmi_detect(void) 1122static int __init abituguru3_dmi_detect(void)
1125{ 1123{
1126 const char *board_vendor, *board_name; 1124 const char *board_vendor, *board_name;
@@ -1159,15 +1157,6 @@ static int __init abituguru3_dmi_detect(void)
1159 return 1; 1157 return 1;
1160} 1158}
1161 1159
1162#else /* !CONFIG_DMI */
1163
1164static inline int abituguru3_dmi_detect(void)
1165{
1166 return 1;
1167}
1168
1169#endif /* CONFIG_DMI */
1170
1171/* FIXME: Manual detection should die eventually; we need to collect stable 1160/* FIXME: Manual detection should die eventually; we need to collect stable
1172 * DMI model names first before we can rely entirely on CONFIG_DMI. 1161 * DMI model names first before we can rely entirely on CONFIG_DMI.
1173 */ 1162 */
@@ -1216,10 +1205,8 @@ static int __init abituguru3_init(void)
1216 if (err) 1205 if (err)
1217 return err; 1206 return err;
1218 1207
1219#ifdef CONFIG_DMI
1220 pr_warn("this motherboard was not detected using DMI. " 1208 pr_warn("this motherboard was not detected using DMI. "
1221 "Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n"); 1209 "Please send the output of \"dmidecode\" to the abituguru3 maintainer (see MAINTAINERS)\n");
1222#endif
1223 } 1210 }
1224 1211
1225 err = platform_driver_register(&abituguru3_driver); 1212 err = platform_driver_register(&abituguru3_driver);