[PATCH] Make sure therm_adt746x only handles known hardware
authorColin Leroy <colin@colino.net>
Wed, 25 May 2005 19:31:34 +0000 (12:31 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 25 May 2005 22:31:29 +0000 (15:31 -0700)
This patch limits therm_adt746x to currently existing fan controllers in
Apple laptops.  It may avoid problems with future hardware.

Signed-off-by: Colin Leroy <colin@colino.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/macintosh/therm_adt746x.c

index e0ac63e..c7e84ab 100644 (file)
@@ -545,6 +545,12 @@ thermostat_init(void)
        else
                return -ENODEV;
 
+       prop = (u32 *)get_property(np, "hwsensor-params-version", NULL);
+       printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop,
+                        (*prop == 1)?"":"un");
+       if (*prop != 1)
+               return -ENODEV;
+
        prop = (u32 *)get_property(np, "reg", NULL);
        if (!prop)
                return -ENODEV;