Skip to contentSkip to conversation

hwmon: Missing class check in two hwmon

PATCH New Jean Delvare 1 participant 1 message Oct 17, 2005 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 7/14 hwmon: Missing class check in two hwmon

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.

---
 drivers/hwmon/atxp1.c  |    2 ++
 drivers/hwmon/ds1621.c |    2 ++
 2 files changed, 4 insertions(+)
drivers/hwmon/atxp1.c +2 -0
@@ -253,6 +253,8 @@
 
 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);
 };
 
drivers/hwmon/ds1621.c +2 -0
@@ -180,6 +180,8 @@
 
 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);
 }
 
Signature · 1 line
Jean Delvare