Skip to content

Commit

Permalink
hwmon: refuse to load abituguru driver on non-Abit boards
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans de Goede authored and Mark M. Hoffman committed Jul 19, 2007
1 parent 9c2e14a commit c182f5b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/hwmon/abituguru.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c182f5b

Please sign in to comment.