Skip to contentSkip to conversation

mlxsw: remove I2C_CLASS_HWMON from drivers w/o detect and address_list

PATCH Applied Heiner Kallweit 3 participants 3 messages Jan 27, 2024 – Jan 31, 2024

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

PATCH 1/1 mlxsw: 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/net/ethernet/mellanox/mlxsw/minimal.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/minimal.c +0 -1
index 6b98c3287..f0ceb196a 100644
@@ -708,7 +708,6 @@ static const struct i2c_device_id mlxsw_m_i2c_id[] = {
 
 static struct i2c_driver mlxsw_m_i2c_driver = {
 	.driver.name = "mlxsw_minimal",
-	.class = I2C_CLASS_HWMON,
 	.id_table = mlxsw_m_i2c_id,
 };
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 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.

Quoted 19 lines
---
 drivers/net/ethernet/mellanox/mlxsw/minimal.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/minimal.c +0 -1
index 6b98c3287..f0ceb196a 100644
@@ -708,7 +708,6 @@ static const struct i2c_device_id mlxsw_m_i2c_id[] = {
 
 static struct i2c_driver mlxsw_m_i2c_driver = {
 	.driver.name = "mlxsw_minimal",
-	.class = I2C_CLASS_HWMON,
 	.id_table = mlxsw_m_i2c_id,
 };
 
Signature · 1 line
2.43.0
#2 lore raw
In reply to Heiner Kallweit
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Sat, 27 Jan 2024 16:08:18 +0100 you wrote:

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.

[...]

Here is the summary with links:
- [net-next] mlxsw: remove I2C_CLASS_HWMON from drivers w/o detect and address_list

    https://git.kernel.org/netdev/net-next/c/ccf1445204a1

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html