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 2/5] iio: adc: exynos: Simplify with dev_err_probe
Date: Fri, 19 Dec 2025 15:31:51 +0100 [thread overview]
Message-ID: <20251219-iio-dev-err-probe-v1-2-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/exynos_adc.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c
index 1484adff00df..491e8dcfd91e 100644
--- a/drivers/iio/adc/exynos_adc.c
+++ b/drivers/iio/adc/exynos_adc.c
@@ -564,10 +564,8 @@ static int exynos_adc_probe(struct platform_device *pdev)
info = iio_priv(indio_dev);
info->data = exynos_adc_get_data(pdev);
- if (!info->data) {
- dev_err(&pdev->dev, "failed getting exynos_adc_data\n");
- return -EINVAL;
- }
+ if (!info->data)
+ return dev_err_probe(&pdev->dev, -EINVAL, "failed getting exynos_adc_data\n");
info->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(info->regs))
@@ -578,10 +576,9 @@ static int exynos_adc_probe(struct platform_device *pdev)
info->pmu_map = syscon_regmap_lookup_by_phandle(
pdev->dev.of_node,
"samsung,syscon-phandle");
- if (IS_ERR(info->pmu_map)) {
- dev_err(&pdev->dev, "syscon regmap lookup failed.\n");
- return PTR_ERR(info->pmu_map);
- }
+ if (IS_ERR(info->pmu_map))
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->pmu_map),
+ "syscon regmap lookup failed.\n");
}
irq = platform_get_irq(pdev, 0);
@@ -593,20 +590,14 @@ static int exynos_adc_probe(struct platform_device *pdev)
init_completion(&info->completion);
info->clk = devm_clk_get(&pdev->dev, "adc");
- if (IS_ERR(info->clk)) {
- dev_err(&pdev->dev, "failed getting clock, err = %ld\n",
- PTR_ERR(info->clk));
- return PTR_ERR(info->clk);
- }
+ if (IS_ERR(info->clk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->clk), "failed getting clock\n");
if (info->data->needs_sclk) {
info->sclk = devm_clk_get(&pdev->dev, "sclk");
- if (IS_ERR(info->sclk)) {
- dev_err(&pdev->dev,
- "failed getting sclk clock, err = %ld\n",
- PTR_ERR(info->sclk));
- return PTR_ERR(info->sclk);
- }
+ if (IS_ERR(info->sclk))
+ return dev_err_probe(&pdev->dev, PTR_ERR(info->sclk),
+ "failed getting sclk clock\n");
}
info->vdd = devm_regulator_get(&pdev->dev, "vdd");
--
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 ` Krzysztof Kozlowski [this message]
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 ` [PATCH 4/5] iio: adc: rockchip: " Krzysztof Kozlowski
2025-12-19 14:51 ` 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-2-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