Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8bacec0 authored by Colin Leroy's avatar Colin Leroy Committed by Linus Torvalds
Browse files

[PATCH] Make sure therm_adt746x only handles known hardware



This patch limits therm_adt746x to currently existing fan controllers in
Apple laptops.  It may avoid problems with future hardware.

Signed-off-by: default avatarColin Leroy <colin@colino.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3bf4fb82
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -545,6 +545,12 @@ thermostat_init(void)
	else
	else
		return -ENODEV;
		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);
	prop = (u32 *)get_property(np, "reg", NULL);
	if (!prop)
	if (!prop)
		return -ENODEV;
		return -ENODEV;