All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch
@ 2007-07-08 12:14 Hans de Goede
  2007-07-08 17:52 ` Mark M. Hoffman
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Hans de Goede @ 2007-07-08 12:14 UTC (permalink / raw)
  To: lm-sensors

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi all,

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>

Regards,

Hans

[-- Attachment #2: hwmon-abituguru-check-dmi-vendor.patch --]
[-- Type: text/x-patch, Size: 1066 bytes --]

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>
diff -up linux-2.6.22-rc4/drivers/hwmon/abituguru.c~ linux-2.6.22-rc4/drivers/hwmon/abituguru.c
--- linux-2.6.22-rc4/drivers/hwmon/abituguru.c~	2007-07-08 14:06:28.000000000 +0200
+++ linux-2.6.22-rc4/drivers/hwmon/abituguru.c	2007-07-08 14:08:36.000000000 +0200
@@ -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 */
@@ -1446,6 +1447,14 @@ 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 (!board_vendor || strcmp(board_vendor, "http://www.abit.com.tw/"))
+		return -ENODEV;
+#endif
+
 	address = abituguru_detect();
 	if (address < 0)
 		return address;

[-- Attachment #3: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-13 17:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-08 12:14 [lm-sensors] PATCH: hwmon-abituguru-check-dmi-vendor.patch Hans de Goede
2007-07-08 17:52 ` Mark M. Hoffman
2007-07-08 18:06 ` Hans de Goede
2007-07-08 18:07 ` Hans de Goede
2007-07-09 18:27 ` Jean Delvare
2007-07-09 18:37 ` Jean Delvare
2007-07-09 20:37 ` Pavel Machek
2007-07-10  9:43 ` Jean Delvare
2007-07-10 15:09 ` Hans de Goede
2007-07-13 17:34 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.