summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2023-09-23 23:54:06 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-25 11:16:53 +0200
commitf65bed0696f7046c800a708d956a16192534bcec (patch)
tree9ea9c0f1888b4d4fa33fd925f150cf4a5399bee4
parentc2088392ac058bd9be3b339ab3beb4c65b7308a6 (diff)
downloadlinux-stable-f65bed0696f7046c800a708d956a16192534bcec.tar.gz
linux-stable-f65bed0696f7046c800a708d956a16192534bcec.tar.bz2
linux-stable-f65bed0696f7046c800a708d956a16192534bcec.zip
i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
[ 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>
-rw-r--r--drivers/i2c/i2c-mux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index f330690b4125..83a79bcb71ea 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -334,7 +334,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);