From: Hans de Goede Date: Tue, 10 Jul 2007 15:09:57 +0000 (+0200) Subject: hwmon: refuse to load abituguru driver on non-Abit boards X-Git-Tag: v2.6.23-rc1~258^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c182f5bbfb399b1fa2ad65107b3caf9c1c69435e;p=linux-2.6-omap-h63xx.git 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 Acked-by: Jean Delvare Signed-off-by: Mark M. Hoffman --- diff --git a/drivers/hwmon/abituguru.c b/drivers/hwmon/abituguru.c index c6186672405..d575ee958de 100644 --- a/drivers/hwmon/abituguru.c +++ b/drivers/hwmon/abituguru.c @@ -31,6 +31,7 @@ #include #include #include +#include #include /* 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;