public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
@ 2023-09-23 21:54 Heiner Kallweit
  2023-09-24 21:01 ` Peter Rosin
  2023-09-25  6:22 ` Wolfram Sang
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2023-09-23 21:54 UTC (permalink / raw)
  To: Peter Rosin, Wolfram Sang; +Cc: linux-i2c@vger.kernel.org

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>
---
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(-)

diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 313904be5..57ff09f18 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -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);
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
  2023-09-23 21:54 [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Heiner Kallweit
@ 2023-09-24 21:01 ` Peter Rosin
  2023-09-25  6:22 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Rosin @ 2023-09-24 21:01 UTC (permalink / raw)
  To: Heiner Kallweit, Wolfram Sang; +Cc: linux-i2c@vger.kernel.org

Hi!

2023-09-23 at 23:54, Heiner Kallweit wrote:
> 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>

Looks sane to me.

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter
  2023-09-23 21:54 [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Heiner Kallweit
  2023-09-24 21:01 ` Peter Rosin
@ 2023-09-25  6:22 ` Wolfram Sang
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2023-09-25  6:22 UTC (permalink / raw)
  To: Heiner Kallweit; +Cc: Peter Rosin, linux-i2c@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 356 bytes --]

On Sat, Sep 23, 2023 at 11:54:06PM +0200, Heiner Kallweit wrote:
> 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>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-25  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-23 21:54 [PATCH] i2c: mux: Avoid potential false error message in i2c_mux_add_adapter Heiner Kallweit
2023-09-24 21:01 ` Peter Rosin
2023-09-25  6:22 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox