diff options
author | Hans de Goede <j.w.r.degoede@hhs.nl> | 2007-07-10 11:09:57 -0400 |
---|---|---|
committer | Mark M. Hoffman <mhoffman@lightlink.com> | 2007-07-19 14:25:04 -0400 |
commit | c182f5bbfb399b1fa2ad65107b3caf9c1c69435e (patch) | |
tree | 14ba543861f37d6afc79ff304c378df82b0618f1 /drivers/hwmon | |
parent | 9c2e14afb98f761ec80ea809adbc87b15b060e7b (diff) |
hwmon: refuse to load abituguru driver on non-Abit boards
With this patch the abituguru refuses to load on non Abit motherboards, as
discussed in lkml CONFIG_BREAK_MY_MACHINE thread.
Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/abituguru.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index c6186672405a..d575ee958de5 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/hwmon.h> | 32 | #include <linux/hwmon.h> |
33 | #include <linux/hwmon-sysfs.h> | 33 | #include <linux/hwmon-sysfs.h> |
34 | #include <linux/dmi.h> | ||
34 | #include <asm/io.h> | 35 | #include <asm/io.h> |
35 | 36 | ||
36 | /* Banks */ | 37 | /* Banks */ |
@@ -1447,6 +1448,15 @@ static int __init abituguru_init(void) | |||
1447 | int address, err; | 1448 | int address, err; |
1448 | struct resource res = { .flags = IORESOURCE_IO }; | 1449 | struct resource res = { .flags = IORESOURCE_IO }; |
1449 | 1450 | ||
1451 | #ifdef CONFIG_DMI | ||
1452 | char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR); | ||
1453 | |||
1454 | /* safety check, refuse to load on non Abit motherboards */ | ||
1455 | if (!force && (!board_vendor || | ||
1456 | strcmp(board_vendor, "http://www.abit.com.tw/"))) | ||
1457 | return -ENODEV; | ||
1458 | #endif | ||
1459 | |||
1450 | address = abituguru_detect(); | 1460 | address = abituguru_detect(); |
1451 | if (address < 0) | 1461 | if (address < 0) |
1452 | return address; | 1462 | return address; |