All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-03  8:38 ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

Hi!

Many users of the i2c_mux_add_adapter interface log a message
on failure, but the function already logs such a message. One
or two of those users actually add more information than already
provided by the central failure message.

So, first fix the central error reporting to provide as much
information as any current user, and then remove the surplus
error reporting at the call sites.

Cheers,
peda

Peter Rosin (9):
  i2c: mux: provide more info on failure in i2c_mux_add_adapter
  i2c: arb: gpio-challenge: stop double error reporting
  i2c: mux: gpio: stop double error reporting
  i2c: mux: pca9541: stop double error reporting
  i2c: mux: pca954x: stop double error reporting
  i2c: mux: pinctrl: stop double error reporting
  i2c: mux: reg: stop double error reporting
  iio: gyro: mpu3050: stop double error reporting
  [media] cx231xx: stop double error reporting

 drivers/i2c/i2c-mux.c                      |  9 ++++++---
 drivers/i2c/muxes/i2c-arb-gpio-challenge.c |  4 +---
 drivers/i2c/muxes/i2c-mux-gpio.c           |  4 +---
 drivers/i2c/muxes/i2c-mux-pca9541.c        |  4 +---
 drivers/i2c/muxes/i2c-mux-pca954x.c        |  7 +------
 drivers/i2c/muxes/i2c-mux-pinctrl.c        |  4 +---
 drivers/i2c/muxes/i2c-mux-reg.c            |  4 +---
 drivers/iio/gyro/mpu3050-i2c.c             |  5 ++---
 drivers/media/usb/cx231xx/cx231xx-i2c.c    | 15 ++++-----------
 9 files changed, 18 insertions(+), 38 deletions(-)

-- 
2.1.4

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

* [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-03  8:38 ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

Hi!

Many users of the i2c_mux_add_adapter interface log a message
on failure, but the function already logs such a message. One
or two of those users actually add more information than already
provided by the central failure message.

So, first fix the central error reporting to provide as much
information as any current user, and then remove the surplus
error reporting at the call sites.

Cheers,
peda

Peter Rosin (9):
  i2c: mux: provide more info on failure in i2c_mux_add_adapter
  i2c: arb: gpio-challenge: stop double error reporting
  i2c: mux: gpio: stop double error reporting
  i2c: mux: pca9541: stop double error reporting
  i2c: mux: pca954x: stop double error reporting
  i2c: mux: pinctrl: stop double error reporting
  i2c: mux: reg: stop double error reporting
  iio: gyro: mpu3050: stop double error reporting
  [media] cx231xx: stop double error reporting

 drivers/i2c/i2c-mux.c                      |  9 ++++++---
 drivers/i2c/muxes/i2c-arb-gpio-challenge.c |  4 +---
 drivers/i2c/muxes/i2c-mux-gpio.c           |  4 +---
 drivers/i2c/muxes/i2c-mux-pca9541.c        |  4 +---
 drivers/i2c/muxes/i2c-mux-pca954x.c        |  7 +------
 drivers/i2c/muxes/i2c-mux-pinctrl.c        |  4 +---
 drivers/i2c/muxes/i2c-mux-reg.c            |  4 +---
 drivers/iio/gyro/mpu3050-i2c.c             |  5 ++---
 drivers/media/usb/cx231xx/cx231xx-i2c.c    | 15 ++++-----------
 9 files changed, 18 insertions(+), 38 deletions(-)

-- 
2.1.4

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

* [PATCH 1/9] i2c: mux: provide more info on failure in i2c_mux_add_adapter
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

No callers then need to report any further info, thus reducing both the
amount of code and the log noise.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/i2c-mux.c | 9 ++++++---
 1 file 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;
 	}
-- 
2.1.4

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

* [PATCH 1/9] i2c: mux: provide more info on failure in i2c_mux_add_adapter
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

No callers then need to report any further info, thus reducing both the
amount of code and the log noise.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/i2c-mux.c | 9 ++++++---
 1 file 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;
 	}
-- 
2.1.4

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

* [PATCH 2/9] i2c: arb: gpio-challenge: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-arb-gpio-challenge.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
index 86fc2d4c081b..812b8cff265f 100644
--- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
+++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
@@ -202,10 +202,8 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
 
 	/* Actually add the mux adapter */
 	ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
-	if (ret) {
-		dev_err(dev, "Failed to add adapter\n");
+	if (ret)
 		i2c_put_adapter(muxc->parent);
-	}
 
 	return ret;
 }
-- 
2.1.4

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

* [PATCH 2/9] i2c: arb: gpio-challenge: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-media-u79uwXL29TY76Z2rM5mHXA

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
---
 drivers/i2c/muxes/i2c-arb-gpio-challenge.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
index 86fc2d4c081b..812b8cff265f 100644
--- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
+++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c
@@ -202,10 +202,8 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
 
 	/* Actually add the mux adapter */
 	ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
-	if (ret) {
-		dev_err(dev, "Failed to add adapter\n");
+	if (ret)
 		i2c_put_adapter(muxc->parent);
-	}
 
 	return ret;
 }
-- 
2.1.4

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

* [PATCH 3/9] i2c: mux: gpio: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-gpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 655684d621a4..1a9973ede443 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -245,10 +245,8 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
 		unsigned int class = mux->data.classes ? mux->data.classes[i] : 0;
 
 		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto add_adapter_failed;
-		}
 	}
 
 	dev_info(&pdev->dev, "%d port mux on %s adapter\n",
-- 
2.1.4

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

* [PATCH 3/9] i2c: mux: gpio: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-gpio.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c
index 655684d621a4..1a9973ede443 100644
--- a/drivers/i2c/muxes/i2c-mux-gpio.c
+++ b/drivers/i2c/muxes/i2c-mux-gpio.c
@@ -245,10 +245,8 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
 		unsigned int class = mux->data.classes ? mux->data.classes[i] : 0;
 
 		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto add_adapter_failed;
-		}
 	}
 
 	dev_info(&pdev->dev, "%d port mux on %s adapter\n",
-- 
2.1.4

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

* [PATCH 4/9] i2c: mux: pca9541: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca9541.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c
index 77840f7845a1..9e318c9516c7 100644
--- a/drivers/i2c/muxes/i2c-mux-pca9541.c
+++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
@@ -369,10 +369,8 @@ static int pca9541_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, muxc);
 
 	ret = i2c_mux_add_adapter(muxc, force, 0, 0);
-	if (ret) {
-		dev_err(&client->dev, "failed to register master selector\n");
+	if (ret)
 		return ret;
-	}
 
 	dev_info(&client->dev, "registered master selector for I2C %s\n",
 		 client->name);
-- 
2.1.4

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

* [PATCH 4/9] i2c: mux: pca9541: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca9541.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c
index 77840f7845a1..9e318c9516c7 100644
--- a/drivers/i2c/muxes/i2c-mux-pca9541.c
+++ b/drivers/i2c/muxes/i2c-mux-pca9541.c
@@ -369,10 +369,8 @@ static int pca9541_probe(struct i2c_client *client,
 	i2c_set_clientdata(client, muxc);
 
 	ret = i2c_mux_add_adapter(muxc, force, 0, 0);
-	if (ret) {
-		dev_err(&client->dev, "failed to register master selector\n");
+	if (ret)
 		return ret;
-	}
 
 	dev_info(&client->dev, "registered master selector for I2C %s\n",
 		 client->name);
-- 
2.1.4

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

* [PATCH 5/9] i2c: mux: pca954x: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 15dfc1648716..b2a85a2d00f7 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -434,13 +434,8 @@ static int pca954x_probe(struct i2c_client *client,
 				   idle_disconnect_dt) << num;
 
 		ret = i2c_mux_add_adapter(muxc, force, num, class);
-
-		if (ret) {
-			dev_err(&client->dev,
-				"failed to register multiplexed adapter"
-				" %d as bus %d\n", num, force);
+		if (ret)
 			goto fail_del_adapters;
-		}
 	}
 
 	dev_info(&client->dev,
-- 
2.1.4

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

* [PATCH 5/9] i2c: mux: pca954x: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c
index 15dfc1648716..b2a85a2d00f7 100644
--- a/drivers/i2c/muxes/i2c-mux-pca954x.c
+++ b/drivers/i2c/muxes/i2c-mux-pca954x.c
@@ -434,13 +434,8 @@ static int pca954x_probe(struct i2c_client *client,
 				   idle_disconnect_dt) << num;
 
 		ret = i2c_mux_add_adapter(muxc, force, num, class);
-
-		if (ret) {
-			dev_err(&client->dev,
-				"failed to register multiplexed adapter"
-				" %d as bus %d\n", num, force);
+		if (ret)
 			goto fail_del_adapters;
-		}
 	}
 
 	dev_info(&client->dev,
-- 
2.1.4

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

* [PATCH 6/9] i2c: mux: pinctrl: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pinctrl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c
index 35bb775e1b74..7c0c264b07bc 100644
--- a/drivers/i2c/muxes/i2c-mux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c
@@ -245,10 +245,8 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
 				(mux->pdata->base_bus_num + i) : 0;
 
 		ret = i2c_mux_add_adapter(muxc, bus, i, 0);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto err_del_adapter;
-		}
 	}
 
 	return 0;
-- 
2.1.4

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

* [PATCH 6/9] i2c: mux: pinctrl: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-pinctrl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c
index 35bb775e1b74..7c0c264b07bc 100644
--- a/drivers/i2c/muxes/i2c-mux-pinctrl.c
+++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c
@@ -245,10 +245,8 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
 				(mux->pdata->base_bus_num + i) : 0;
 
 		ret = i2c_mux_add_adapter(muxc, bus, i, 0);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto err_del_adapter;
-		}
 	}
 
 	return 0;
-- 
2.1.4

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

* [PATCH 7/9] i2c: mux: reg: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index c6a90b4a9c62..406d5059072c 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -222,10 +222,8 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
 		class = mux->data.classes ? mux->data.classes[i] : 0;
 
 		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto add_adapter_failed;
-		}
 	}
 
 	dev_dbg(&pdev->dev, "%d port mux on %s adapter\n",
-- 
2.1.4

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

* [PATCH 7/9] i2c: mux: reg: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-media-u79uwXL29TY76Z2rM5mHXA

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
---
 drivers/i2c/muxes/i2c-mux-reg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/muxes/i2c-mux-reg.c b/drivers/i2c/muxes/i2c-mux-reg.c
index c6a90b4a9c62..406d5059072c 100644
--- a/drivers/i2c/muxes/i2c-mux-reg.c
+++ b/drivers/i2c/muxes/i2c-mux-reg.c
@@ -222,10 +222,8 @@ static int i2c_mux_reg_probe(struct platform_device *pdev)
 		class = mux->data.classes ? mux->data.classes[i] : 0;
 
 		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], class);
-		if (ret) {
-			dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
+		if (ret)
 			goto add_adapter_failed;
-		}
 	}
 
 	dev_dbg(&pdev->dev, "%d port mux on %s adapter\n",
-- 
2.1.4

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

* [PATCH 8/9] iio: gyro: mpu3050: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/iio/gyro/mpu3050-i2c.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
index 06007200bf49..93f08b304a63 100644
--- a/drivers/iio/gyro/mpu3050-i2c.c
+++ b/drivers/iio/gyro/mpu3050-i2c.c
@@ -70,9 +70,8 @@ static int mpu3050_i2c_probe(struct i2c_client *client,
 		dev_err(&client->dev, "failed to allocate I2C mux\n");
 	else {
 		mpu3050->i2cmux->priv = mpu3050;
-		ret = i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0, 0);
-		if (ret)
-			dev_err(&client->dev, "failed to add I2C mux\n");
+		/* Ignore failure, not critical */
+		i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0, 0);
 	}
 
 	return 0;
-- 
2.1.4

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

* [PATCH 8/9] iio: gyro: mpu3050: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/iio/gyro/mpu3050-i2c.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
index 06007200bf49..93f08b304a63 100644
--- a/drivers/iio/gyro/mpu3050-i2c.c
+++ b/drivers/iio/gyro/mpu3050-i2c.c
@@ -70,9 +70,8 @@ static int mpu3050_i2c_probe(struct i2c_client *client,
 		dev_err(&client->dev, "failed to allocate I2C mux\n");
 	else {
 		mpu3050->i2cmux->priv = mpu3050;
-		ret = i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0, 0);
-		if (ret)
-			dev_err(&client->dev, "failed to add I2C mux\n");
+		/* Ignore failure, not critical */
+		i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0, 0);
 	}
 
 	return 0;
-- 
2.1.4

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

* [PATCH 9/9] [media] cx231xx: stop double error reporting
  2017-04-03  8:38 ` Peter Rosin
@ 2017-04-03  8:38   ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 35e9acfe63d3..dff514e147da 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -576,17 +576,10 @@ int cx231xx_i2c_mux_create(struct cx231xx *dev)
 
 int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
 {
-	int rc;
-
-	rc = i2c_mux_add_adapter(dev->muxc,
-				 0,
-				 mux_no /* chan_id */,
-				 0 /* class */);
-	if (rc)
-		dev_warn(dev->dev,
-			 "i2c mux %d register FAILED\n", mux_no);
-
-	return rc;
+	return i2c_mux_add_adapter(dev->muxc,
+				   0,
+				   mux_no /* chan_id */,
+				   0 /* class */);
 }
 
 void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
-- 
2.1.4

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

* [PATCH 9/9] [media] cx231xx: stop double error reporting
@ 2017-04-03  8:38   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03  8:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

i2c_mux_add_adapter already logs a message on failure.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 drivers/media/usb/cx231xx/cx231xx-i2c.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 35e9acfe63d3..dff514e147da 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -576,17 +576,10 @@ int cx231xx_i2c_mux_create(struct cx231xx *dev)
 
 int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
 {
-	int rc;
-
-	rc = i2c_mux_add_adapter(dev->muxc,
-				 0,
-				 mux_no /* chan_id */,
-				 0 /* class */);
-	if (rc)
-		dev_warn(dev->dev,
-			 "i2c mux %d register FAILED\n", mux_no);
-
-	return rc;
+	return i2c_mux_add_adapter(dev->muxc,
+				   0,
+				   mux_no /* chan_id */,
+				   0 /* class */);
 }
 
 void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
-- 
2.1.4

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

* Re: [PATCH 9/9] [media] cx231xx: stop double error reporting
  2017-04-03  8:38   ` Peter Rosin
  (?)
@ 2017-04-03 10:26   ` Wolfram Sang
  2017-04-03 11:13       ` Peter Rosin
  -1 siblings, 1 reply; 33+ messages in thread
From: Wolfram Sang @ 2017-04-03 10:26 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

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

On Mon, Apr 03, 2017 at 10:38:38AM +0200, Peter Rosin wrote:
> i2c_mux_add_adapter already logs a message on failure.
> 
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
>  drivers/media/usb/cx231xx/cx231xx-i2c.c | 15 ++++-----------
>  1 file changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> index 35e9acfe63d3..dff514e147da 100644
> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
> @@ -576,17 +576,10 @@ int cx231xx_i2c_mux_create(struct cx231xx *dev)
>  
>  int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
>  {
> -	int rc;
> -
> -	rc = i2c_mux_add_adapter(dev->muxc,
> -				 0,
> -				 mux_no /* chan_id */,
> -				 0 /* class */);
> -	if (rc)
> -		dev_warn(dev->dev,
> -			 "i2c mux %d register FAILED\n", mux_no);
> -
> -	return rc;
> +	return i2c_mux_add_adapter(dev->muxc,
> +				   0,
> +				   mux_no /* chan_id */,
> +				   0 /* class */);

Could be argued that the whole function is obsolete now and the
c231xx-core can call i2c_mux_add_adapter() directly. But maybe this is a
seperate patch.

>  }
>  
>  void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
> -- 
> 2.1.4
> 

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

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-03 10:27   ` Wolfram Sang
  0 siblings, 0 replies; 33+ messages in thread
From: Wolfram Sang @ 2017-04-03 10:27 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

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

On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:
> Hi!
> 
> Many users of the i2c_mux_add_adapter interface log a message
> on failure, but the function already logs such a message. One
> or two of those users actually add more information than already
> provided by the central failure message.
> 
> So, first fix the central error reporting to provide as much
> information as any current user, and then remove the surplus
> error reporting at the call sites.

Yes, I like.

Reviewed-by: Wolfram Sang <wsa@the-dreams.de>


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

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-03 10:27   ` Wolfram Sang
  0 siblings, 0 replies; 33+ messages in thread
From: Wolfram Sang @ 2017-04-03 10:27 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Peter Korsgaard,
	Guenter Roeck, Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-media-u79uwXL29TY76Z2rM5mHXA

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

On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:
> Hi!
> 
> Many users of the i2c_mux_add_adapter interface log a message
> on failure, but the function already logs such a message. One
> or two of those users actually add more information than already
> provided by the central failure message.
> 
> So, first fix the central error reporting to provide as much
> information as any current user, and then remove the surplus
> error reporting at the call sites.

Yes, I like.

Reviewed-by: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>


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

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

* Re: [PATCH 9/9] [media] cx231xx: stop double error reporting
  2017-04-03 10:26   ` Wolfram Sang
@ 2017-04-03 11:13       ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03 11:13 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On 2017-04-03 12:26, Wolfram Sang wrote:
> On Mon, Apr 03, 2017 at 10:38:38AM +0200, Peter Rosin wrote:
>> i2c_mux_add_adapter already logs a message on failure.
>>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
>> ---
>>  drivers/media/usb/cx231xx/cx231xx-i2c.c | 15 ++++-----------
>>  1 file changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> index 35e9acfe63d3..dff514e147da 100644
>> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> @@ -576,17 +576,10 @@ int cx231xx_i2c_mux_create(struct cx231xx *dev)
>>  
>>  int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
>>  {
>> -	int rc;
>> -
>> -	rc = i2c_mux_add_adapter(dev->muxc,
>> -				 0,
>> -				 mux_no /* chan_id */,
>> -				 0 /* class */);
>> -	if (rc)
>> -		dev_warn(dev->dev,
>> -			 "i2c mux %d register FAILED\n", mux_no);
>> -
>> -	return rc;
>> +	return i2c_mux_add_adapter(dev->muxc,
>> +				   0,
>> +				   mux_no /* chan_id */,
>> +				   0 /* class */);
> 
> Could be argued that the whole function is obsolete now and the
> c231xx-core can call i2c_mux_add_adapter() directly. But maybe this is a
> seperate patch.

Agreed on all counts. BTW, the ..._unregister function below is equally
"obsolete". I'm going to leave the removal of both functions at the
discretion of whomever takes care of cx231xx maintenance...

Cheers,
peda

>>  }
>>  
>>  void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
>> -- 
>> 2.1.4
>>

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

* Re: [PATCH 9/9] [media] cx231xx: stop double error reporting
@ 2017-04-03 11:13       ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03 11:13 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On 2017-04-03 12:26, Wolfram Sang wrote:
> On Mon, Apr 03, 2017 at 10:38:38AM +0200, Peter Rosin wrote:
>> i2c_mux_add_adapter already logs a message on failure.
>>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
>> ---
>>  drivers/media/usb/cx231xx/cx231xx-i2c.c | 15 ++++-----------
>>  1 file changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> index 35e9acfe63d3..dff514e147da 100644
>> --- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> +++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
>> @@ -576,17 +576,10 @@ int cx231xx_i2c_mux_create(struct cx231xx *dev)
>>  
>>  int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no)
>>  {
>> -	int rc;
>> -
>> -	rc = i2c_mux_add_adapter(dev->muxc,
>> -				 0,
>> -				 mux_no /* chan_id */,
>> -				 0 /* class */);
>> -	if (rc)
>> -		dev_warn(dev->dev,
>> -			 "i2c mux %d register FAILED\n", mux_no);
>> -
>> -	return rc;
>> +	return i2c_mux_add_adapter(dev->muxc,
>> +				   0,
>> +				   mux_no /* chan_id */,
>> +				   0 /* class */);
> 
> Could be argued that the whole function is obsolete now and the
> c231xx-core can call i2c_mux_add_adapter() directly. But maybe this is a
> seperate patch.

Agreed on all counts. BTW, the ..._unregister function below is equally
"obsolete". I'm going to leave the removal of both functions at the
discretion of whomever takes care of cx231xx maintenance...

Cheers,
peda

>>  }
>>  
>>  void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
>> -- 
>> 2.1.4
>>

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
  2017-04-03 10:27   ` Wolfram Sang
@ 2017-04-03 11:27     ` Peter Rosin
  -1 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03 11:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On 2017-04-03 12:27, Wolfram Sang wrote:
> On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:
>> Hi!
>>
>> Many users of the i2c_mux_add_adapter interface log a message
>> on failure, but the function already logs such a message. One
>> or two of those users actually add more information than already
>> provided by the central failure message.
>>
>> So, first fix the central error reporting to provide as much
>> information as any current user, and then remove the surplus
>> error reporting at the call sites.
> 
> Yes, I like.
> 
> Reviewed-by: Wolfram Sang <wsa@the-dreams.de>

Thanks!

BTW, the improved error reporting in patch 1/9 is not needed for
patches 8/9 and 9/9 to make sense, the existing central error
message is already good enough. So, iio and media maintainers,
feel free to just grab those two patches. Or, they can go via
Wolfram and the i2c tree with the rest of the series. Either way
is fine with me, just let me know.

Cheers,
peda

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-03 11:27     ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-03 11:27 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On 2017-04-03 12:27, Wolfram Sang wrote:
> On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:
>> Hi!
>>
>> Many users of the i2c_mux_add_adapter interface log a message
>> on failure, but the function already logs such a message. One
>> or two of those users actually add more information than already
>> provided by the central failure message.
>>
>> So, first fix the central error reporting to provide as much
>> information as any current user, and then remove the surplus
>> error reporting at the call sites.
> 
> Yes, I like.
> 
> Reviewed-by: Wolfram Sang <wsa@the-dreams.de>

Thanks!

BTW, the improved error reporting in patch 1/9 is not needed for
patches 8/9 and 9/9 to make sense, the existing central error
message is already good enough. So, iio and media maintainers,
feel free to just grab those two patches. Or, they can go via
Wolfram and the i2c tree with the rest of the series. Either way
is fine with me, just let me know.

Cheers,
peda

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

* Re: [PATCH 8/9] iio: gyro: mpu3050: stop double error reporting
  2017-04-03  8:38   ` Peter Rosin
  (?)
@ 2017-04-03 17:56   ` Linus Walleij
  2017-04-03 19:42     ` Jonathan Cameron
  -1 siblings, 1 reply; 33+ messages in thread
From: Linus Walleij @ 2017-04-03 17:56 UTC (permalink / raw)
  To: Peter Rosin
  Cc: linux-kernel, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On Mon, Apr 3, 2017 at 10:38 AM, Peter Rosin <peda@axentia.se> wrote:

> i2c_mux_add_adapter already logs a message on failure.
>
> Signed-off-by: Peter Rosin <peda@axentia.se>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH 8/9] iio: gyro: mpu3050: stop double error reporting
  2017-04-03 17:56   ` Linus Walleij
@ 2017-04-03 19:42     ` Jonathan Cameron
  0 siblings, 0 replies; 33+ messages in thread
From: Jonathan Cameron @ 2017-04-03 19:42 UTC (permalink / raw)
  To: Linus Walleij, Peter Rosin
  Cc: linux-kernel, Wolfram Sang, Peter Korsgaard, Guenter Roeck,
	Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

On 03/04/17 18:56, Linus Walleij wrote:
> On Mon, Apr 3, 2017 at 10:38 AM, Peter Rosin <peda@axentia.se> wrote:
> 
>> i2c_mux_add_adapter already logs a message on failure.
>>
>> Signed-off-by: Peter Rosin <peda@axentia.se>
> 
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Applied to the togreg branch of iio.git.

Can't see any reason not to split this set up and apply through
the various trees so I've picked this one up.

Good little series.  We should do more of these in general!

Jonathan
> 
> Yours,
> Linus Walleij
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-11  8:08   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-11  8:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Wolfram Sang, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab, linux-i2c,
	linux-iio, linux-media

On 2017-04-03 10:38, Peter Rosin wrote:
> Hi!
> 
> Many users of the i2c_mux_add_adapter interface log a message
> on failure, but the function already logs such a message. One
> or two of those users actually add more information than already
> provided by the central failure message.
> 
> So, first fix the central error reporting to provide as much
> information as any current user, and then remove the surplus
> error reporting at the call sites.

I have now pushed patches 1-7 to i2c-mux/for-next.
Jonathan grabbed patch 8 and it's going through the iio tree.
Still waiting on patch 9 and the media maintainers.

Cheers,
Peter

> 
> Cheers,
> peda
> 
> Peter Rosin (9):
>   i2c: mux: provide more info on failure in i2c_mux_add_adapter
>   i2c: arb: gpio-challenge: stop double error reporting
>   i2c: mux: gpio: stop double error reporting
>   i2c: mux: pca9541: stop double error reporting
>   i2c: mux: pca954x: stop double error reporting
>   i2c: mux: pinctrl: stop double error reporting
>   i2c: mux: reg: stop double error reporting
>   iio: gyro: mpu3050: stop double error reporting
>   [media] cx231xx: stop double error reporting
> 
>  drivers/i2c/i2c-mux.c                      |  9 ++++++---
>  drivers/i2c/muxes/i2c-arb-gpio-challenge.c |  4 +---
>  drivers/i2c/muxes/i2c-mux-gpio.c           |  4 +---
>  drivers/i2c/muxes/i2c-mux-pca9541.c        |  4 +---
>  drivers/i2c/muxes/i2c-mux-pca954x.c        |  7 +------
>  drivers/i2c/muxes/i2c-mux-pinctrl.c        |  4 +---
>  drivers/i2c/muxes/i2c-mux-reg.c            |  4 +---
>  drivers/iio/gyro/mpu3050-i2c.c             |  5 ++---
>  drivers/media/usb/cx231xx/cx231xx-i2c.c    | 15 ++++-----------
>  9 files changed, 18 insertions(+), 38 deletions(-)
> 

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-11  8:08   ` Peter Rosin
  0 siblings, 0 replies; 33+ messages in thread
From: Peter Rosin @ 2017-04-11  8:08 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Wolfram Sang, Peter Korsgaard, Guenter Roeck, Linus Walleij,
	Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Mauro Carvalho Chehab,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA,
	linux-media-u79uwXL29TY76Z2rM5mHXA

On 2017-04-03 10:38, Peter Rosin wrote:
> Hi!
> 
> Many users of the i2c_mux_add_adapter interface log a message
> on failure, but the function already logs such a message. One
> or two of those users actually add more information than already
> provided by the central failure message.
> 
> So, first fix the central error reporting to provide as much
> information as any current user, and then remove the surplus
> error reporting at the call sites.

I have now pushed patches 1-7 to i2c-mux/for-next.
Jonathan grabbed patch 8 and it's going through the iio tree.
Still waiting on patch 9 and the media maintainers.

Cheers,
Peter

> 
> Cheers,
> peda
> 
> Peter Rosin (9):
>   i2c: mux: provide more info on failure in i2c_mux_add_adapter
>   i2c: arb: gpio-challenge: stop double error reporting
>   i2c: mux: gpio: stop double error reporting
>   i2c: mux: pca9541: stop double error reporting
>   i2c: mux: pca954x: stop double error reporting
>   i2c: mux: pinctrl: stop double error reporting
>   i2c: mux: reg: stop double error reporting
>   iio: gyro: mpu3050: stop double error reporting
>   [media] cx231xx: stop double error reporting
> 
>  drivers/i2c/i2c-mux.c                      |  9 ++++++---
>  drivers/i2c/muxes/i2c-arb-gpio-challenge.c |  4 +---
>  drivers/i2c/muxes/i2c-mux-gpio.c           |  4 +---
>  drivers/i2c/muxes/i2c-mux-pca9541.c        |  4 +---
>  drivers/i2c/muxes/i2c-mux-pca954x.c        |  7 +------
>  drivers/i2c/muxes/i2c-mux-pinctrl.c        |  4 +---
>  drivers/i2c/muxes/i2c-mux-reg.c            |  4 +---
>  drivers/iio/gyro/mpu3050-i2c.c             |  5 ++---
>  drivers/media/usb/cx231xx/cx231xx-i2c.c    | 15 ++++-----------
>  9 files changed, 18 insertions(+), 38 deletions(-)
> 

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
  2017-04-03 11:27     ` Peter Rosin
@ 2017-04-19 10:29       ` Mauro Carvalho Chehab
  -1 siblings, 0 replies; 33+ messages in thread
From: Mauro Carvalho Chehab @ 2017-04-19 10:29 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Wolfram Sang, linux-kernel, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

Em Mon, 3 Apr 2017 13:27:48 +0200
Peter Rosin <peda@axentia.se> escreveu:

> On 2017-04-03 12:27, Wolfram Sang wrote:
> > On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:  
> >> Hi!
> >>
> >> Many users of the i2c_mux_add_adapter interface log a message
> >> on failure, but the function already logs such a message. One
> >> or two of those users actually add more information than already
> >> provided by the central failure message.
> >>
> >> So, first fix the central error reporting to provide as much
> >> information as any current user, and then remove the surplus
> >> error reporting at the call sites.  
> > 
> > Yes, I like.
> > 
> > Reviewed-by: Wolfram Sang <wsa@the-dreams.de>  
> 
> Thanks!
> 
> BTW, the improved error reporting in patch 1/9 is not needed for
> patches 8/9 and 9/9 to make sense, the existing central error
> message is already good enough. So, iio and media maintainers,
> feel free to just grab those two patches. Or, they can go via
> Wolfram and the i2c tree with the rest of the series. Either way
> is fine with me, just let me know.

Feel free to submit via I2C tree, together with the patch series:

Reviewed-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

> 
> Cheers,
> peda



Thanks,
Mauro

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

* Re: [PATCH 0/9] Unify i2c_mux_add_adapter error reporting
@ 2017-04-19 10:29       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 33+ messages in thread
From: Mauro Carvalho Chehab @ 2017-04-19 10:29 UTC (permalink / raw)
  To: Peter Rosin
  Cc: Wolfram Sang, linux-kernel, Peter Korsgaard, Guenter Roeck,
	Linus Walleij, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler,
	Mauro Carvalho Chehab, linux-i2c, linux-iio, linux-media

Em Mon, 3 Apr 2017 13:27:48 +0200
Peter Rosin <peda@axentia.se> escreveu:

> On 2017-04-03 12:27, Wolfram Sang wrote:
> > On Mon, Apr 03, 2017 at 10:38:29AM +0200, Peter Rosin wrote:  
> >> Hi!
> >>
> >> Many users of the i2c_mux_add_adapter interface log a message
> >> on failure, but the function already logs such a message. One
> >> or two of those users actually add more information than already
> >> provided by the central failure message.
> >>
> >> So, first fix the central error reporting to provide as much
> >> information as any current user, and then remove the surplus
> >> error reporting at the call sites.  
> > 
> > Yes, I like.
> > 
> > Reviewed-by: Wolfram Sang <wsa@the-dreams.de>  
> 
> Thanks!
> 
> BTW, the improved error reporting in patch 1/9 is not needed for
> patches 8/9 and 9/9 to make sense, the existing central error
> message is already good enough. So, iio and media maintainers,
> feel free to just grab those two patches. Or, they can go via
> Wolfram and the i2c tree with the rest of the series. Either way
> is fine with me, just let me know.

Feel free to submit via I2C tree, together with the patch series:

Reviewed-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

> 
> Cheers,
> peda



Thanks,
Mauro

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

end of thread, other threads:[~2017-04-19 10:29 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03  8:38 [PATCH 0/9] Unify i2c_mux_add_adapter error reporting Peter Rosin
2017-04-03  8:38 ` Peter Rosin
2017-04-03  8:38 ` [PATCH 1/9] i2c: mux: provide more info on failure in i2c_mux_add_adapter Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 2/9] i2c: arb: gpio-challenge: stop double error reporting Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 3/9] i2c: mux: gpio: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 4/9] i2c: mux: pca9541: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 5/9] i2c: mux: pca954x: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 6/9] i2c: mux: pinctrl: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 7/9] i2c: mux: reg: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03  8:38 ` [PATCH 8/9] iio: gyro: mpu3050: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03 17:56   ` Linus Walleij
2017-04-03 19:42     ` Jonathan Cameron
2017-04-03  8:38 ` [PATCH 9/9] [media] cx231xx: " Peter Rosin
2017-04-03  8:38   ` Peter Rosin
2017-04-03 10:26   ` Wolfram Sang
2017-04-03 11:13     ` Peter Rosin
2017-04-03 11:13       ` Peter Rosin
2017-04-03 10:27 ` [PATCH 0/9] Unify i2c_mux_add_adapter " Wolfram Sang
2017-04-03 10:27   ` Wolfram Sang
2017-04-03 11:27   ` Peter Rosin
2017-04-03 11:27     ` Peter Rosin
2017-04-19 10:29     ` Mauro Carvalho Chehab
2017-04-19 10:29       ` Mauro Carvalho Chehab
2017-04-11  8:08 ` Peter Rosin
2017-04-11  8:08   ` Peter Rosin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.