linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mfd: madera: Simplify with dev_err_probe()
@ 2020-08-26 14:49 Krzysztof Kozlowski
  2020-08-26 14:49 ` [PATCH 2/3] mfd: stmfx: " Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:49 UTC (permalink / raw)
  To: Charles Keepax, Richard Fitzgerald, Lee Jones, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mfd/madera-core.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/madera-core.c b/drivers/mfd/madera-core.c
index 8a8d733fdce5..4ed6ad8ce002 100644
--- a/drivers/mfd/madera-core.c
+++ b/drivers/mfd/madera-core.c
@@ -369,19 +369,14 @@ EXPORT_SYMBOL_GPL(madera_of_match);
 static int madera_get_reset_gpio(struct madera *madera)
 {
 	struct gpio_desc *reset;
-	int ret;
 
 	if (madera->pdata.reset)
 		return 0;
 
 	reset = devm_gpiod_get_optional(madera->dev, "reset", GPIOD_OUT_LOW);
-	if (IS_ERR(reset)) {
-		ret = PTR_ERR(reset);
-		if (ret != -EPROBE_DEFER)
-			dev_err(madera->dev, "Failed to request /RESET: %d\n",
-				ret);
-		return ret;
-	}
+	if (IS_ERR(reset))
+		return dev_err_probe(madera->dev, PTR_ERR(reset),
+				"Failed to request /RESET");
 
 	/*
 	 * A hard reset is needed for full reset of the chip. We allow running
-- 
2.17.1


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

* [PATCH 2/3] mfd: stmfx: Simplify with dev_err_probe()
  2020-08-26 14:49 [PATCH 1/3] mfd: madera: Simplify with dev_err_probe() Krzysztof Kozlowski
@ 2020-08-26 14:49 ` Krzysztof Kozlowski
  2020-08-28 10:10   ` Lee Jones
  2020-08-26 14:49 ` [PATCH 3/3] mfd: wcd934x: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:49 UTC (permalink / raw)
  To: Charles Keepax, Richard Fitzgerald, Lee Jones, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mfd/stmfx.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 711979afd90a..5e680bfdf5c9 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -331,11 +331,9 @@ static int stmfx_chip_init(struct i2c_client *client)
 	ret = PTR_ERR_OR_ZERO(stmfx->vdd);
 	if (ret == -ENODEV) {
 		stmfx->vdd = NULL;
-	} else if (ret == -EPROBE_DEFER) {
-		return ret;
-	} else if (ret) {
-		dev_err(&client->dev, "Failed to get VDD regulator: %d\n", ret);
-		return ret;
+	} else {
+		return dev_err_probe(&client->dev, ret,
+				     "Failed to get VDD regulator\n");
 	}
 
 	if (stmfx->vdd) {
-- 
2.17.1


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

* [PATCH 3/3] mfd: wcd934x: Simplify with dev_err_probe()
  2020-08-26 14:49 [PATCH 1/3] mfd: madera: Simplify with dev_err_probe() Krzysztof Kozlowski
  2020-08-26 14:49 ` [PATCH 2/3] mfd: stmfx: " Krzysztof Kozlowski
@ 2020-08-26 14:49 ` Krzysztof Kozlowski
  2020-08-28 10:10   ` Lee Jones
  2020-08-28  9:44 ` [PATCH 1/3] mfd: madera: " Charles Keepax
  2020-08-28 10:09 ` Lee Jones
  3 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2020-08-26 14:49 UTC (permalink / raw)
  To: Charles Keepax, Richard Fitzgerald, Lee Jones, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel
  Cc: Krzysztof Kozlowski

Common pattern of handling deferred probe can be simplified with
dev_err_probe().  Less code and also it prints the error value.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/mfd/wcd934x.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index da910302d51a..c274d733b656 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -219,12 +219,9 @@ static int wcd934x_slim_probe(struct slim_device *sdev)
 		return	-ENOMEM;
 
 	ddata->irq = of_irq_get(np, 0);
-	if (ddata->irq < 0) {
-		if (ddata->irq != -EPROBE_DEFER)
-			dev_err(ddata->dev, "Failed to get IRQ: err = %d\n",
-				ddata->irq);
-		return ddata->irq;
-	}
+	if (ddata->irq < 0)
+		return dev_err_probe(ddata->dev, ddata->irq,
+				     "Failed to get IRQ\n");
 
 	reset_gpio = of_get_named_gpio(np, "reset-gpios", 0);
 	if (reset_gpio < 0) {
-- 
2.17.1


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

* Re: [PATCH 1/3] mfd: madera: Simplify with dev_err_probe()
  2020-08-26 14:49 [PATCH 1/3] mfd: madera: Simplify with dev_err_probe() Krzysztof Kozlowski
  2020-08-26 14:49 ` [PATCH 2/3] mfd: stmfx: " Krzysztof Kozlowski
  2020-08-26 14:49 ` [PATCH 3/3] mfd: wcd934x: " Krzysztof Kozlowski
@ 2020-08-28  9:44 ` Charles Keepax
  2020-08-28 10:09 ` Lee Jones
  3 siblings, 0 replies; 7+ messages in thread
From: Charles Keepax @ 2020-08-28  9:44 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Richard Fitzgerald, Lee Jones, Maxime Coquelin, Alexandre Torgue,
	alsa-devel, patches, linux-kernel, linux-stm32, linux-arm-kernel

On Wed, Aug 26, 2020 at 04:49:33PM +0200, Krzysztof Kozlowski wrote:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 1/3] mfd: madera: Simplify with dev_err_probe()
  2020-08-26 14:49 [PATCH 1/3] mfd: madera: Simplify with dev_err_probe() Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2020-08-28  9:44 ` [PATCH 1/3] mfd: madera: " Charles Keepax
@ 2020-08-28 10:09 ` Lee Jones
  3 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2020-08-28 10:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Charles Keepax, Richard Fitzgerald, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel

On Wed, 26 Aug 2020, Krzysztof Kozlowski wrote:

> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/mfd/madera-core.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 2/3] mfd: stmfx: Simplify with dev_err_probe()
  2020-08-26 14:49 ` [PATCH 2/3] mfd: stmfx: " Krzysztof Kozlowski
@ 2020-08-28 10:10   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2020-08-28 10:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Charles Keepax, Richard Fitzgerald, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel

On Wed, 26 Aug 2020, Krzysztof Kozlowski wrote:

> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/mfd/stmfx.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/3] mfd: wcd934x: Simplify with dev_err_probe()
  2020-08-26 14:49 ` [PATCH 3/3] mfd: wcd934x: " Krzysztof Kozlowski
@ 2020-08-28 10:10   ` Lee Jones
  0 siblings, 0 replies; 7+ messages in thread
From: Lee Jones @ 2020-08-28 10:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Charles Keepax, Richard Fitzgerald, Maxime Coquelin,
	Alexandre Torgue, alsa-devel, patches, linux-kernel, linux-stm32,
	linux-arm-kernel

On Wed, 26 Aug 2020, Krzysztof Kozlowski wrote:

> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/mfd/wcd934x.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2020-08-28 10:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-26 14:49 [PATCH 1/3] mfd: madera: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-26 14:49 ` [PATCH 2/3] mfd: stmfx: " Krzysztof Kozlowski
2020-08-28 10:10   ` Lee Jones
2020-08-26 14:49 ` [PATCH 3/3] mfd: wcd934x: " Krzysztof Kozlowski
2020-08-28 10:10   ` Lee Jones
2020-08-28  9:44 ` [PATCH 1/3] mfd: madera: " Charles Keepax
2020-08-28 10:09 ` Lee Jones

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