]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 23 Sep 2023 21:54:06 +0000 (23:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Oct 2023 09:58:59 +0000 (11:58 +0200)
[ Upstream commit b13e59e74ff71a1004e0508107e91e9a84fd7388 ]

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.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/i2c-mux.c

index 774507b54b57b7e722ee77fa1e8952fb29b30b1c..c90cec8d9656d80af0eb0cc85bf4ae9e06da4963 100644 (file)
@@ -340,7 +340,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);