Skip to contentSkip to conversation

ipmi: ipmb: Remove I2C_CLASS_HWMON from drivers w/o detect and address_list

PATCH In review Heiner Kallweit 2 participants 3 messages Jan 27, 2024 – Mar 2, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipmi: ipmb: Remove I2C_CLASS_HWMON from drivers w/o detect and address_list

Class-based I2C probing requires detect() and address_list to be set in the I2C client driver, see checks in i2c_detect(). It's misleading to declare I2C_CLASS_HWMON support if this precondition isn't met.

---
 drivers/char/ipmi/ipmi_ipmb.c | 1 -
 1 file changed, 1 deletion(-)
drivers/char/ipmi/ipmi_ipmb.c +0 -1
index 4e335832f..9e5c6d682 100644
@@ -567,7 +567,6 @@ static const struct i2c_device_id ipmi_ipmb_id[] = {
 MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
 
 static struct i2c_driver ipmi_ipmb_driver = {
-	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name = DEVICE_NAME,
 		.of_match_table = of_ipmi_ipmb_match,
Signature · 1 line
2.43.0
#2 lore raw
In reply to Heiner Kallweit
Quoted 5 lines · Heiner Kallweit

Class-based I2C probing requires detect() and address_list to be set in the I2C client driver, see checks in i2c_detect(). It's misleading to declare I2C_CLASS_HWMON support if this precondition isn't met.

Any feedback here? Should this better go through the I2C tree?

Quoted 17 lines
---
 drivers/char/ipmi/ipmi_ipmb.c | 1 -
 1 file changed, 1 deletion(-)
drivers/char/ipmi/ipmi_ipmb.c +0 -1
index 4e335832f..9e5c6d682 100644
@@ -567,7 +567,6 @@ static const struct i2c_device_id ipmi_ipmb_id[] = {
 MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
 
 static struct i2c_driver ipmi_ipmb_driver = {
-	.class		= I2C_CLASS_HWMON,
 	.driver = {
 		.name = DEVICE_NAME,
 		.of_match_table = of_ipmi_ipmb_match,