From: Niloy Meharchandani <niloymeharchandani@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Niloy Meharchandani <niloymeharchandani@gmail.com>
Subject: [PATCH] hwmon: (pmbus/xdp710) Use dev_err_probe()
Date: Sat, 14 Nov 2026 18:20:53 -0800 [thread overview]
Message-ID: <20261115022053.32321-1-niloymeharchandani@gmail.com> (raw)
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
next reply other threads:[~2026-11-15 2:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 2:20 Niloy Meharchandani [this message]
2026-11-15 13:34 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261115022053.32321-1-niloymeharchandani@gmail.com \
--to=niloymeharchandani@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®