summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-mux.c
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2017-04-03 09:28:43 +0200
committerPeter Rosin <peda@axentia.se>2017-04-03 14:07:31 +0200
commit8d4d159f25a79bdaf1f8ae5536471ba9b26b26c2 (patch)
tree693efa15f15634021ed62ed1b6423ceaeb9c5f65 /drivers/i2c/i2c-mux.c
parenti2c: mux: pca954x: make use of raw_spinlock variants (diff)
downloadlinux-8d4d159f25a79bdaf1f8ae5536471ba9b26b26c2.tar.xz
linux-8d4d159f25a79bdaf1f8ae5536471ba9b26b26c2.zip
i2c: mux: provide more info on failure in i2c_mux_add_adapter
No callers then need to report any further info, thus reducing both the amount of code and the log noise. Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
Diffstat (limited to 'drivers/i2c/i2c-mux.c')
-rw-r--r--drivers/i2c/i2c-mux.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c
index 2178266bca79..26f7237558ba 100644
--- a/drivers/i2c/i2c-mux.c
+++ b/drivers/i2c/i2c-mux.c
@@ -395,13 +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);
} 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 (error=%d)\n",
- ret);
kfree(priv);
return ret;
}