* [PATCH] i2c: fix "failed to add mux-adapter" message
@ 2017-05-16 11:05 Russell King
2017-05-16 11:10 ` Peter Rosin
0 siblings, 1 reply; 2+ messages in thread
From: Russell King @ 2017-05-16 11:05 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Peter Rosin, linux-i2c
i2c-mux always prints the "failed to add mux-adapter" message even when
the mux adapter is successfully registered. Fix this.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/i2c/i2c-mux.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 26f7237558ba..d5258c13fe57 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -395,14 +395,16 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
if (force_nr) {
priv->adap.nr = force_nr;
ret = i2c_add_numbered_adapter(&priv->adap);
- dev_err(&parent->dev,
- "failed to add mux-adapter %u as bus %u (error=%d)\n",
- chan_id, force_nr, ret);
+ if (ret < 0)
+ dev_err(&parent->dev,
+ "failed to add mux-adapter %u as bus %u (error=%d)\n",
+ chan_id, force_nr, ret);
} else {
ret = i2c_add_adapter(&priv->adap);
- dev_err(&parent->dev,
- "failed to add mux-adapter %u (error=%d)\n",
- chan_id, ret);
+ if (ret < 0)
+ dev_err(&parent->dev,
+ "failed to add mux-adapter %u (error=%d)\n",
+ chan_id, ret);
}
if (ret < 0) {
kfree(priv);
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c: fix "failed to add mux-adapter" message
2017-05-16 11:05 [PATCH] i2c: fix "failed to add mux-adapter" message Russell King
@ 2017-05-16 11:10 ` Peter Rosin
0 siblings, 0 replies; 2+ messages in thread
From: Peter Rosin @ 2017-05-16 11:10 UTC (permalink / raw)
To: Russell King, Wolfram Sang; +Cc: linux-i2c
On 2017-05-16 13:05, Russell King wrote:
> i2c-mux always prints the "failed to add mux-adapter" message even when
> the mux adapter is successfully registered. Fix this.
Yes, sorry about that. However, a similar fix [1] is already queued.
Cheers,
peda
[1] https://lkml.org/lkml/2017/5/15/62
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-16 11:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-16 11:05 [PATCH] i2c: fix "failed to add mux-adapter" message Russell King
2017-05-16 11:10 ` Peter Rosin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).