Commit ddec748f328af6b67e4d0ce0248a8e9f36751827

Authored by Jean Delvare
Committed by Greg Kroah-Hartman
1 parent 7ab83a9137

[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>

Showing 2 changed files with 4 additions and 0 deletions Side-by-side Diff

drivers/hwmon/atxp1.c
... ... @@ -253,6 +253,8 @@
253 253  
254 254 static int atxp1_attach_adapter(struct i2c_adapter *adapter)
255 255 {
  256 + if (!(adapter->class & I2C_CLASS_HWMON))
  257 + return 0;
256 258 return i2c_probe(adapter, &addr_data, &atxp1_detect);
257 259 };
258 260  
drivers/hwmon/ds1621.c
... ... @@ -180,6 +180,8 @@
180 180  
181 181 static int ds1621_attach_adapter(struct i2c_adapter *adapter)
182 182 {
  183 + if (!(adapter->class & I2C_CLASS_HWMON))
  184 + return 0;
183 185 return i2c_probe(adapter, &addr_data, ds1621_detect);
184 186 }
185 187