Skip to contentSkip to conversation

hwmon: add missing class checks

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: add missing class checks

Hi all,

I am enqueuing the following patch.

Aurelien, Sebastian, please confirm that this doesn't break your respective setups. If it does, then the bus driver you are using needs to be fixed.

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