aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2005-10-17 17:02:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 17:02:11 -0400
commitddec748f328af6b67e4d0ce0248a8e9f36751827 (patch)
treece99658260e0a5f3d56e67d5d33ce8e498947990
parent7ab83a9137ccd3e092fb6ad0cb105b4d1fb617ae (diff)
[PATCH] hwmon: Missing class check in two hwmon drivers
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>
-rw-r--r--drivers/hwmon/atxp1.c2
-rw-r--r--drivers/hwmon/ds1621.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c
index deb4d34c9539..441324fc6b8b 100644
--- a/drivers/hwmon/atxp1.c
+++ b/drivers/hwmon/atxp1.c
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IWUSR, atxp1_showgpio2, atxp1_storegpio2);
253 253
254static int atxp1_attach_adapter(struct i2c_adapter *adapter) 254static int atxp1_attach_adapter(struct i2c_adapter *adapter)
255{ 255{
256 if (!(adapter->class & I2C_CLASS_HWMON))
257 return 0;
256 return i2c_probe(adapter, &addr_data, &atxp1_detect); 258 return i2c_probe(adapter, &addr_data, &atxp1_detect);
257}; 259};
258 260
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index b0199e063d0e..e1ff22cf984a 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -180,6 +180,8 @@ static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);
180 180
181static int ds1621_attach_adapter(struct i2c_adapter *adapter) 181static int ds1621_attach_adapter(struct i2c_adapter *adapter)
182{ 182{
183 if (!(adapter->class & I2C_CLASS_HWMON))
184 return 0;
183 return i2c_probe(adapter, &addr_data, ds1621_detect); 185 return i2c_probe(adapter, &addr_data, ds1621_detect);
184} 186}
185 187