From khali@linux-fr.org Mon Oct 17 14:04:25 2005 Date: Mon, 17 Oct 2005 23:02:42 +0200 From: Jean Delvare To: Greg KH Subject: [PATCH 07/14] hwmon: Missing class check in two hwmon drivers Message-Id: <20051017230242.1b29cbd6.khali@linux-fr.org> Content-Disposition: inline; filename=hwmon-missing-driver-class.patch The atxp1 and ds1621 drivers should make sure they do not probe non-hwmon i2c adapters. Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/atxp1.c | 2 ++ drivers/hwmon/ds1621.c | 2 ++ 2 files changed, 4 insertions(+) --- gregkh-2.6.orig/drivers/hwmon/atxp1.c +++ gregkh-2.6/drivers/hwmon/atxp1.c @@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IW 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); }; --- gregkh-2.6.orig/drivers/hwmon/ds1621.c +++ gregkh-2.6/drivers/hwmon/ds1621.c @@ -180,6 +180,8 @@ static DEVICE_ATTR(temp1_max, S_IWUSR | 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); }