i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
Subsystems (3)
PATCH 1/1 i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
I2C_CLASS_DEPRECATED is a flag and not an actual class. There's nothing speaking against both, parent and child, having I2C_CLASS_DEPRECATED set. Therefore exclude it from the check.
---
I'm not aware of any current issue, therefore no Fixes tag. However I'm preparing a change to i2c-i801 where this could be an issue.
--- drivers/i2c/i2c-mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/i2c-mux.c +1 -1
@@ -341,7 +341,7 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc, priv->adap.lock_ops = &i2c_parent_lock_ops;/* Sanity check on class */ -if (i2c_mux_parent_classes (parent) & class) +if (i2c_mux_parent_classes (parent) & class & ~I2C_CLASS_DEPRECATED )dev_err (&parent->dev,"Segment %d behind mux can't share classes with ancestors\n" , chan_id);
Signature · 1 line
2.42.0
Hi!
Quoted 5 lines · Heiner Kallweit
I2C_CLASS_DEPRECATEDis a flag and not an actual class. There's nothing speaking against both, parent and child, havingI2C_CLASS_DEPRECATEDset. Therefore exclude it from the check.Signed-off-by Heiner Kallweit <[email protected]>
Looks sane to me.
Cheers,
Peter
Wolfram Sang
AppliedQuoted 5 lines · Heiner Kallweit
I2C_CLASS_DEPRECATEDis a flag and not an actual class. There's nothing speaking against both, parent and child, havingI2C_CLASS_DEPRECATEDset. Therefore exclude it from the check.Signed-off-by Heiner Kallweit <[email protected]>
Applied to for-current, thanks!