Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c182f5bbfb399b1fa2ad65107b3caf9c1c69435e
Commit:     c182f5bbfb399b1fa2ad65107b3caf9c1c69435e
Parent:     9c2e14afb98f761ec80ea809adbc87b15b060e7b
Author:     Hans de Goede <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 10 17:09:57 2007 +0200
Committer:  Mark M. Hoffman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 14:25:04 2007 -0400

    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 <[EMAIL PROTECTED]>
    Acked-by: Jean Delvare <[EMAIL PROTECTED]>
    Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 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 c618667..d575ee9 100644
--- a/drivers/hwmon/abituguru.c
+++ b/drivers/hwmon/abituguru.c
@@ -31,6 +31,7 @@
 #include <linux/platform_device.h>
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
+#include <linux/dmi.h>
 #include <asm/io.h>
 
 /* Banks */
@@ -1447,6 +1448,15 @@ static int __init abituguru_init(void)
        int address, err;
        struct resource res = { .flags = IORESOURCE_IO };
 
+#ifdef CONFIG_DMI
+       char *board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
+
+       /* safety check, refuse to load on non Abit motherboards */
+       if (!force && (!board_vendor ||
+                       strcmp(board_vendor, "http://www.abit.com.tw/";)))
+               return -ENODEV;
+#endif
+
        address = abituguru_detect();
        if (address < 0)
                return address;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to