Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddec748f authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman
Browse files

[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: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7ab83a91
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IWUSR, atxp1_showgpio2, atxp1_storegpio2);

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);
};

+2 −0
Original line number Diff line number Diff line
@@ -180,6 +180,8 @@ static DEVICE_ATTR(temp1_max, S_IWUSR | S_IRUGO, show_temp_max, set_temp_max);

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);
}