]> err.no Git - linux-2.6/commitdiff
[PATCH] hwmon: Missing class check in two hwmon drivers
authorJean Delvare <khali@linux-fr.org>
Mon, 17 Oct 2005 21:02:42 +0000 (23:02 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 21:02:11 +0000 (14:02 -0700)
The atxp1 and ds1621 drivers should make sure they do not probe
non-hwmon i2c adapters.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/hwmon/atxp1.c
drivers/hwmon/ds1621.c

index deb4d34c9539bab6428d9f5fad5d62a357b787b2..441324fc6b8bf7c1b27404df8f68f6405d76223b 100644 (file)
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IWUSR, atxp1_showgpio2, atxp1_storegpio2);
 
 static int atxp1_attach_adapter(struct i2c_adapter *adapter)
 {
+       if (!(adapter->class & I2C_CLASS_HWMON))
+               return 0;
        return i2c_probe(adapter, &addr_data, &atxp1_detect);
 };
 
index b0199e063d0ebf02f1b8f92910086b0353f5cd55..e1ff22cf984afc86e5afec89f83efeff43d111f5 100644 (file)
@@ -180,6 +180,8 @@ static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
 
 static int ds1621_attach_adapter(struct i2c_adapter *adapter)
 {
+       if (!(adapter->class & I2C_CLASS_HWMON))
+               return 0;
        return i2c_probe(adapter, &addr_data, ds1621_detect);
 }