linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfc: trf7970a: Make use of the helper function dev_err_probe()
@ 2021-09-16 15:36 Cai Huoqing
  2021-09-16 19:27 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-16 15:36 UTC (permalink / raw)
  To: caihuoqing
  Cc: Mark Greer, Krzysztof Kozlowski, linux-wireless, netdev, linux-kernel

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/nfc/trf7970a.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 8890fcd59c39..8459a2735f2c 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -2067,8 +2067,8 @@ static int trf7970a_probe(struct spi_device *spi)
 
 	trf->regulator = devm_regulator_get(&spi->dev, "vin");
 	if (IS_ERR(trf->regulator)) {
-		ret = PTR_ERR(trf->regulator);
-		dev_err(trf->dev, "Can't get VIN regulator: %d\n", ret);
+		ret = dev_err_probe(trf->dev, PTR_ERR(trf->regulator),
+				    "Can't get VIN regulator\n");
 		goto err_destroy_lock;
 	}
 
@@ -2084,8 +2084,8 @@ static int trf7970a_probe(struct spi_device *spi)
 
 	trf->regulator = devm_regulator_get(&spi->dev, "vdd-io");
 	if (IS_ERR(trf->regulator)) {
-		ret = PTR_ERR(trf->regulator);
-		dev_err(trf->dev, "Can't get VDD_IO regulator: %d\n", ret);
+		ret = dev_err_probe(trf->dev, PTR_ERR(trf->regulator),
+				    "Can't get VDD_IO regulator\n");
 		goto err_destroy_lock;
 	}
 
-- 
2.25.1


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

* Re: [PATCH] nfc: trf7970a: Make use of the helper function dev_err_probe()
  2021-09-16 15:36 [PATCH] nfc: trf7970a: Make use of the helper function dev_err_probe() Cai Huoqing
@ 2021-09-16 19:27 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2021-09-16 19:27 UTC (permalink / raw)
  To: Cai Huoqing; +Cc: Mark Greer, linux-wireless, netdev, linux-kernel

On 16/09/2021 17:36, Cai Huoqing wrote:
> When possible use dev_err_probe help to properly deal with the
> PROBE_DEFER error, the benefit is that DEFER issue will be logged
> in the devices_deferred debugfs file.
> Using dev_err_probe() can reduce code size, and the error value
> gets printed.
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/nfc/trf7970a.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 

Please don't send patches one-by-one, but group them in series.

Same response - I think the preferred approach was Rob's dev_err removal.

P.S. You need to Cc all folks and all lists. The cc-list here is too short.

Best regards,
Krzysztof

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

end of thread, other threads:[~2021-09-16 19:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 15:36 [PATCH] nfc: trf7970a: Make use of the helper function dev_err_probe() Cai Huoqing
2021-09-16 19:27 ` Krzysztof Kozlowski

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