From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 08/12] iio: frequency: adf4377: use dev_err_probe in probe path
Date: Mon, 23 Feb 2026 15:13:59 +0200 [thread overview]
Message-ID: <20260223131418.55414-9-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20260223131418.55414-1-antoniu.miclaus@analog.com>
Replace dev_err() + return with dev_err_probe() in the probe path
to simplify error handling and to ensure the error code is logged.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
drivers/iio/frequency/adf4377.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
index 919b604b2ce6..cfc0c524c4a4 100644
--- a/drivers/iio/frequency/adf4377.c
+++ b/drivers/iio/frequency/adf4377.c
@@ -712,17 +712,15 @@ static int adf4377_init(struct adf4377_state *st)
adf4377_gpio_init(st);
ret = adf4377_soft_reset(st);
- if (ret) {
- dev_err(dev, "Failed to soft reset.\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to soft reset.\n");
ret = regmap_multi_reg_write(st->regmap, adf4377_reg_defaults,
ARRAY_SIZE(adf4377_reg_defaults));
- if (ret) {
- dev_err(dev, "Failed to set default registers.\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to set default registers.\n");
ret = regmap_update_bits(st->regmap, 0x00,
ADF4377_0000_SDO_ACTIVE_MSK | ADF4377_0000_SDO_ACTIVE_R_MSK,
@@ -730,10 +728,9 @@ static int adf4377_init(struct adf4377_state *st)
ADF4377_0000_SDO_ACTIVE_SPI_4W) |
FIELD_PREP(ADF4377_0000_SDO_ACTIVE_R_MSK,
ADF4377_0000_SDO_ACTIVE_SPI_4W));
- if (ret) {
- dev_err(dev, "Failed to set 4-Wire Operation.\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to set 4-Wire Operation.\n");
st->clkin_freq = clk_get_rate(st->clkin);
@@ -747,10 +744,9 @@ static int adf4377_init(struct adf4377_state *st)
FIELD_PREP(ADF4377_001A_PD_PFDCP_MSK, 0) |
FIELD_PREP(ADF4377_001A_PD_CLKOUT1_MSK, 0) |
FIELD_PREP(ADF4377_001A_PD_CLKOUT2_MSK, 0));
- if (ret) {
- dev_err(dev, "Failed to set power down registers.\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to set power down registers.\n");
/* Set Mux Output */
ret = regmap_update_bits(st->regmap, 0x1D,
--
2.43.0
next prev parent reply other threads:[~2026-02-23 13:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 13:13 [PATCH v2 00/12] iio: use dev_err_probe in probe path for ADI drivers Antoniu Miclaus
2026-02-23 13:13 ` [PATCH v2 01/12] iio: frequency: adrf6780: introduce struct device variable Antoniu Miclaus
2026-02-23 13:13 ` [PATCH v2 02/12] iio: frequency: adrf6780: use dev_err_probe in probe path Antoniu Miclaus
2026-02-23 13:13 ` [PATCH v2 03/12] iio: frequency: admv1014: introduce struct device variable Antoniu Miclaus
2026-02-23 13:55 ` Andy Shevchenko
2026-02-23 13:13 ` [PATCH v2 04/12] iio: frequency: admv1014: use dev_err_probe in probe path Antoniu Miclaus
2026-02-23 13:57 ` Andy Shevchenko
2026-02-23 13:13 ` [PATCH v2 05/12] iio: frequency: admv1013: introduce struct device variable Antoniu Miclaus
2026-02-23 13:13 ` [PATCH v2 06/12] iio: frequency: admv1013: use dev_err_probe in probe path Antoniu Miclaus
2026-02-23 13:13 ` [PATCH v2 07/12] iio: frequency: adf4377: introduce struct device variable Antoniu Miclaus
2026-02-23 13:13 ` Antoniu Miclaus [this message]
2026-02-23 13:14 ` [PATCH v2 09/12] iio: dac: ad7293: " Antoniu Miclaus
2026-02-23 13:14 ` [PATCH v2 10/12] iio: dac: ad7293: use dev_err_probe in probe path Antoniu Miclaus
2026-02-23 13:14 ` [PATCH v2 11/12] iio: filter: admv8818: introduce struct device variable Antoniu Miclaus
2026-02-23 13:14 ` [PATCH v2 12/12] iio: filter: admv8818: use dev_err_probe in probe path Antoniu Miclaus
2026-02-23 14:03 ` [PATCH v2 00/12] iio: use dev_err_probe in probe path for ADI drivers Andy Shevchenko
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=20260223131418.55414-9-antoniu.miclaus@analog.com \
--to=antoniu.miclaus@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
/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®