All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (pmbus/xdp710) Use dev_err_probe()
@ 2026-11-15  2:20 Niloy Meharchandani
  2026-11-15  2:24 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Niloy Meharchandani @ 2026-11-15  2:20 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon, linux-kernel, Niloy Meharchandani

Use dev_err_probe() in xdp710_probe() instead of dev_err() followed by
returning the error. This simplifies the error paths and prints the error
code in symbolic form.

No functional change intended. Compile-tested only.

Signed-off-by: Niloy Meharchandani <niloymeharchandani@gmail.com>
---
 drivers/hwmon/pmbus/xdp710.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/hwmon/pmbus/xdp710.c b/drivers/hwmon/pmbus/xdp710.c
index 494dbe45ebc6..34c6cefbfc13 100644
--- a/drivers/hwmon/pmbus/xdp710.c
+++ b/drivers/hwmon/pmbus/xdp710.c
@@ -71,24 +71,18 @@ static int xdp710_probe(struct i2c_client *client)
 		return -ENOMEM;
 
 	ret = i2c_smbus_read_word_data(client, XDP710_CS_RNG);
-	if (ret < 0) {
-		dev_err(&client->dev, "Can't get CS_RNG");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&client->dev, ret, "Can't get CS_RNG\n");
 	cs_rng = (ret >> 6) & GENMASK(1, 0);
 
 	ret = i2c_smbus_read_word_data(client, XDP710_V_SNS_CFG);
-	if (ret < 0) {
-		dev_err(&client->dev, "Can't get V_SNS_CFG");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&client->dev, ret, "Can't get V_SNS_CFG\n");
 	vtlm_rng = ret & GENMASK(1, 0);
 
 	ret = i2c_smbus_read_word_data(client, XDP710_REG_CFG);
-	if (ret < 0) {
-		dev_err(&client->dev, "Can't get REG_CFG");
-		return ret;
-	}
+	if (ret < 0)
+		return dev_err_probe(&client->dev, ret, "Can't get REG_CFG\n");
 	ret &= GENMASK(5, 0);
 	rsense = micro_ohm_rsense[ret];
 
-- 
2.53.0


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

* Re: [PATCH] hwmon: (pmbus/xdp710) Use dev_err_probe()
  2026-11-15  2:20 [PATCH] hwmon: (pmbus/xdp710) Use dev_err_probe() Niloy Meharchandani
@ 2026-11-15  2:24 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-15  2:24 UTC (permalink / raw)
  To: Niloy Meharchandani; +Cc: linux-hwmon

> Use dev_err_probe() in xdp710_probe() instead of dev_err() followed by
> returning the error. This simplifies the error paths and prints the error
> code in symbolic form.
> 
> No functional change intended. Compile-tested only.
> 
> Signed-off-by: Niloy Meharchandani <niloymeharchandani@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261115022053.32321-1-niloymeharchandani@gmail.com?part=1


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

end of thread, other threads:[~2026-11-15  2:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15  2:20 [PATCH] hwmon: (pmbus/xdp710) Use dev_err_probe() Niloy Meharchandani
2026-11-15  2:24 ` sashiko-bot

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.