Skip to contentSkip to conversation

siox: Introduce dev_err_probe helper

PATCH In review Thorsten Scherer 3 participants 4 messages Jun 16, 2021 Siox

lore
Share & tools
lore

Thorsten Scherer

author maintainer
#0 lore raw

v2 cover siox: Introduce dev_err_probe helper

This patch introduces dev_err_probe helper in siox-bus-gpio.c

Changes from v1:

- fix commit message according to checkpatch.pl
- remove company footer
- fix whitespace issues

Thorsten Scherer (1):
siox: Simplify error handling via dev_err_probe()

 drivers/siox/siox-bus-gpio.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

base-commit: 009c9aa5be652675a06d5211e1640e02bbb1c33d

Signature · 1 line
2.29.2
author maintainer
#1 lore raw

PATCH v2 1/1 siox: Simplify error handling via dev_err_probe()

commit a787e5400a1c ("driver core: add device probe log helper") introduced a helper for a common error checking pattern. Use it.

---
 drivers/siox/siox-bus-gpio.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/siox/siox-bus-gpio.c +10 -9
index 46b4cda36bac..aeefeb725524 100644
@@ -102,29 +102,29 @@ static int siox_gpio_probe(struct platform_device *pdev)
 
 	ddata->din = devm_gpiod_get(dev, "din", GPIOD_IN);
 	if (IS_ERR(ddata->din)) {
-		ret = PTR_ERR(ddata->din);
-		dev_err(dev, "Failed to get %s GPIO: %d\n", "din", ret);
+		ret = dev_err_probe(dev, PTR_ERR(ddata->din),
+				    "Failed to get din GPIO\n");
 		goto err;
 	}
 
 	ddata->dout = devm_gpiod_get(dev, "dout", GPIOD_OUT_LOW);
 	if (IS_ERR(ddata->dout)) {
-		ret = PTR_ERR(ddata->dout);
-		dev_err(dev, "Failed to get %s GPIO: %d\n", "dout", ret);
+		ret = dev_err_probe(dev, PTR_ERR(ddata->dout),
+				    "Failed to get dout GPIO\n");
 		goto err;
 	}
 
 	ddata->dclk = devm_gpiod_get(dev, "dclk", GPIOD_OUT_LOW);
 	if (IS_ERR(ddata->dclk)) {
-		ret = PTR_ERR(ddata->dclk);
-		dev_err(dev, "Failed to get %s GPIO: %d\n", "dclk", ret);
+		ret = dev_err_probe(dev, PTR_ERR(ddata->dclk),
+				    "Failed to get dclk GPIO\n");
 		goto err;
 	}
 
 	ddata->dld = devm_gpiod_get(dev, "dld", GPIOD_OUT_LOW);
 	if (IS_ERR(ddata->dld)) {
-		ret = PTR_ERR(ddata->dld);
-		dev_err(dev, "Failed to get %s GPIO: %d\n", "dld", ret);
+		ret = dev_err_probe(dev, PTR_ERR(ddata->dld),
+				    "Failed to get dld GPIO\n");
 		goto err;
 	}
 
@@ -134,7 +134,8 @@ static int siox_gpio_probe(struct platform_device *pdev)
 
 	ret = siox_master_register(smaster);
 	if (ret) {
-		dev_err(dev, "Failed to register siox master: %d\n", ret);
+		dev_err_probe(dev, ret,
+			      "Failed to register siox master\n");
 err:
 		siox_master_put(smaster);
 	}
Signature · 1 line
2.29.2
Acked-by on v2 1/1
#2 lore raw

Re: [PATCH v2 1/1] siox: Simplify error handling via dev_err_probe()

Hello,

Quoted 4 lines · Thorsten Scherer

commit a787e5400a1c ("driver core: add device probe log helper") introduced a helper for a common error checking pattern. Use it.

@gregkh: You used to take siox patches, can you please do that for this patch, too?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#3 lore raw

Re: [PATCH v2 1/1] siox: Simplify error handling via dev_err_probe()

Quoted 6 lines · Uwe Kleine-König

Hello,

Quoted 3 lines · Thorsten Scherer

commit a787e5400a1c ("driver core: add device probe log helper") introduced a helper for a common error checking pattern. Use it.

Quoted 6 lines
Quoted 1 line

@gregkh: You used to take siox patches, can you please do that for this patch, too?

Sure, will be glad to take this, thanks.

greg k-h