From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
To: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Joel Stanley" <joel@jms.id.au>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Alim Akhtar" <alim.akhtar@samsung.com>,
"Heiko Stuebner" <heiko@sntech.de>,
"Orson Zhai" <orsonzhai@gmail.com>,
"Baolin Wang" <baolin.wang@linux.alibaba.com>,
"Chunyan Zhang" <zhang.lyra@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-rockchip@lists.infradead.org,
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Subject: [PATCH 4/5] iio: adc: rockchip: Simplify with dev_err_probe
Date: Fri, 19 Dec 2025 15:31:53 +0100 [thread overview]
Message-ID: <20251219-iio-dev-err-probe-v1-4-bd0fbc83c8a0@oss.qualcomm.com> (raw)
In-Reply-To: <20251219-iio-dev-err-probe-v1-0-bd0fbc83c8a0@oss.qualcomm.com>
Use dev_err_probe() to make error code handling simpler and handle
deferred probe nicely (avoid spamming logs).
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/iio/adc/rockchip_saradc.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/adc/rockchip_saradc.c b/drivers/iio/adc/rockchip_saradc.c
index 6721da0ed7bb..263d80c5fc50 100644
--- a/drivers/iio/adc/rockchip_saradc.c
+++ b/drivers/iio/adc/rockchip_saradc.c
@@ -492,10 +492,9 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
*/
info->reset = devm_reset_control_get_optional_exclusive(&pdev->dev,
"saradc-apb");
- if (IS_ERR(info->reset)) {
- ret = PTR_ERR(info->reset);
- return dev_err_probe(&pdev->dev, ret, "failed to get saradc-apb\n");
- }
+ if (IS_ERR(info->reset))
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->reset),
+ "failed to get saradc-apb\n");
init_completion(&info->completion);
@@ -505,10 +504,8 @@ static int rockchip_saradc_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, irq, rockchip_saradc_isr,
0, dev_name(&pdev->dev), info);
- if (ret < 0) {
- dev_err(&pdev->dev, "failed requesting irq %d\n", irq);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "failed requesting irq %d\n", irq);
info->vref = devm_regulator_get(&pdev->dev, "vref");
if (IS_ERR(info->vref))
--
2.51.0
next prev parent reply other threads:[~2025-12-19 14:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-19 14:31 [PATCH 0/5] iio: adc: Simplify with dev_err_probe Krzysztof Kozlowski
2025-12-19 14:31 ` [PATCH 1/5] iio: adc: aspeed: " Krzysztof Kozlowski
2025-12-21 12:04 ` Jonathan Cameron
2025-12-21 14:05 ` Krzysztof Kozlowski
2025-12-19 14:31 ` [PATCH 2/5] iio: adc: exynos: " Krzysztof Kozlowski
2025-12-19 14:31 ` [PATCH 3/5] iio: adc: qcom-spmi-rradc: " Krzysztof Kozlowski
2025-12-19 14:47 ` Konrad Dybcio
2025-12-19 14:31 ` Krzysztof Kozlowski [this message]
2025-12-19 14:51 ` [PATCH 4/5] iio: adc: rockchip: " Shawn Lin
2025-12-19 14:31 ` [PATCH 5/5] iio: adc: sc27xx: " Krzysztof Kozlowski
2025-12-21 12:04 ` [PATCH 0/5] iio: adc: " Jonathan Cameron
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=20251219-iio-dev-err-probe-v1-4-bd0fbc83c8a0@oss.qualcomm.com \
--to=krzysztof.kozlowski@oss.qualcomm.com \
--cc=alim.akhtar@samsung.com \
--cc=andrew@codeconstruct.com.au \
--cc=andy@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=dlechner@baylibre.com \
--cc=heiko@sntech.de \
--cc=jic23@kernel.org \
--cc=joel@jms.id.au \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=orsonzhai@gmail.com \
--cc=zhang.lyra@gmail.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