* [PATCH 0/5] iio: adc: Simplify with dev_err_probe
@ 2025-12-19 14:31 Krzysztof Kozlowski
2025-12-19 14:31 ` [PATCH 1/5] iio: adc: aspeed: " Krzysztof Kozlowski
` (5 more replies)
0 siblings, 6 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
Use dev_err_probe() to make error code handling simpler and handle
deferred probe nicely (avoid spamming logs).
Best regards,
Krzysztof
---
Krzysztof Kozlowski (5):
iio: adc: aspeed: Simplify with dev_err_probe
iio: adc: exynos: Simplify with dev_err_probe
iio: adc: qcom-spmi-rradc: Simplify with dev_err_probe
iio: adc: rockchip: Simplify with dev_err_probe
iio: adc: sc27xx: Simplify with dev_err_probe
drivers/iio/adc/aspeed_adc.c | 9 ++++---
drivers/iio/adc/exynos_adc.c | 29 ++++++++---------------
drivers/iio/adc/qcom-spmi-rradc.c | 20 ++++++----------
drivers/iio/adc/rockchip_saradc.c | 13 ++++-------
drivers/iio/adc/sc27xx_adc.c | 49 ++++++++++++++-------------------------
5 files changed, 43 insertions(+), 77 deletions(-)
---
base-commit: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
change-id: 20251219-iio-dev-err-probe-59b3104c8d4b
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/5] iio: adc: aspeed: Simplify with dev_err_probe
2025-12-19 14:31 [PATCH 0/5] iio: adc: Simplify with dev_err_probe Krzysztof Kozlowski
@ 2025-12-19 14:31 ` Krzysztof Kozlowski
2025-12-21 12:04 ` Jonathan Cameron
2025-12-19 14:31 ` [PATCH 2/5] iio: adc: exynos: " Krzysztof Kozlowski
` (4 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
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/aspeed_adc.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index bf2bfd6bdc41..1ae45fe90e6c 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -535,11 +535,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
return PTR_ERR(data->clk_scaler);
data->rst = devm_reset_control_get_shared(&pdev->dev, NULL);
- if (IS_ERR(data->rst)) {
- dev_err(&pdev->dev,
- "invalid or missing reset controller device tree entry");
- return PTR_ERR(data->rst);
- }
+ if (IS_ERR(data->rst))
+ return dev_err_probe(&pdev->dev, PTR_ERR(data->rst),
+ "invalid or missing reset controller device tree entry");
+
reset_control_deassert(data->rst);
ret = devm_add_action_or_reset(data->dev, aspeed_adc_reset_assert,
--
2.51.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/5] iio: adc: exynos: Simplify with dev_err_probe
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-19 14:31 ` Krzysztof Kozlowski
2025-12-19 14:31 ` [PATCH 3/5] iio: adc: qcom-spmi-rradc: " Krzysztof Kozlowski
` (3 subsequent siblings)
5 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 3/5] iio: adc: qcom-spmi-rradc: Simplify with dev_err_probe
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-19 14:31 ` [PATCH 2/5] iio: adc: exynos: " Krzysztof Kozlowski
@ 2025-12-19 14:31 ` Krzysztof Kozlowski
2025-12-19 14:47 ` Konrad Dybcio
2025-12-19 14:31 ` [PATCH 4/5] iio: adc: rockchip: " Krzysztof Kozlowski
` (2 subsequent siblings)
5 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
Use dev_err_probe() to make error code handling simpler.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
drivers/iio/adc/qcom-spmi-rradc.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/drivers/iio/adc/qcom-spmi-rradc.c b/drivers/iio/adc/qcom-spmi-rradc.c
index b245416bae12..8e75665204d1 100644
--- a/drivers/iio/adc/qcom-spmi-rradc.c
+++ b/drivers/iio/adc/qcom-spmi-rradc.c
@@ -934,20 +934,15 @@ static int rradc_probe(struct platform_device *pdev)
chip = iio_priv(indio_dev);
chip->regmap = dev_get_regmap(pdev->dev.parent, NULL);
- if (!chip->regmap) {
- dev_err(dev, "Couldn't get parent's regmap\n");
- return -EINVAL;
- }
+ if (!chip->regmap)
+ return dev_err_probe(dev, -EINVAL, "Couldn't get parent's regmap\n");
chip->dev = dev;
mutex_init(&chip->conversion_lock);
ret = device_property_read_u32(dev, "reg", &chip->base);
- if (ret < 0) {
- dev_err(chip->dev, "Couldn't find reg address, ret = %d\n",
- ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Couldn't find reg address\n");
batt_id_delay = -1;
ret = device_property_read_u32(dev, "qcom,batt-id-delay-ms",
@@ -975,10 +970,9 @@ static int rradc_probe(struct platform_device *pdev)
/* Get the PMIC revision, we need it to handle some varying coefficients */
chip->pmic = qcom_pmic_get(chip->dev);
- if (IS_ERR(chip->pmic)) {
- dev_err(chip->dev, "Unable to get reference to PMIC device\n");
- return PTR_ERR(chip->pmic);
- }
+ if (IS_ERR(chip->pmic))
+ return dev_err_probe(dev, PTR_ERR(chip->pmic),
+ "Unable to get reference to PMIC device\n");
switch (chip->pmic->subtype) {
case PMI8998_SUBTYPE:
--
2.51.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 4/5] iio: adc: rockchip: Simplify with dev_err_probe
2025-12-19 14:31 [PATCH 0/5] iio: adc: Simplify with dev_err_probe Krzysztof Kozlowski
` (2 preceding siblings ...)
2025-12-19 14:31 ` [PATCH 3/5] iio: adc: qcom-spmi-rradc: " Krzysztof Kozlowski
@ 2025-12-19 14:31 ` 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
5 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 5/5] iio: adc: sc27xx: Simplify with dev_err_probe
2025-12-19 14:31 [PATCH 0/5] iio: adc: Simplify with dev_err_probe Krzysztof Kozlowski
` (3 preceding siblings ...)
2025-12-19 14:31 ` [PATCH 4/5] iio: adc: rockchip: " Krzysztof Kozlowski
@ 2025-12-19 14:31 ` Krzysztof Kozlowski
2025-12-21 12:04 ` [PATCH 0/5] iio: adc: " Jonathan Cameron
5 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-19 14:31 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Joel Stanley, Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar,
Heiko Stuebner, Orson Zhai, Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip,
Krzysztof Kozlowski
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/sc27xx_adc.c | 49 +++++++++++++++-----------------------------
1 file changed, 17 insertions(+), 32 deletions(-)
diff --git a/drivers/iio/adc/sc27xx_adc.c b/drivers/iio/adc/sc27xx_adc.c
index 2535c2c3e60b..6209499c5c37 100644
--- a/drivers/iio/adc/sc27xx_adc.c
+++ b/drivers/iio/adc/sc27xx_adc.c
@@ -867,10 +867,8 @@ static int sc27xx_adc_probe(struct platform_device *pdev)
int ret;
pdata = of_device_get_match_data(dev);
- if (!pdata) {
- dev_err(dev, "No matching driver data found\n");
- return -EINVAL;
- }
+ if (!pdata)
+ return dev_err_probe(dev, -EINVAL, "No matching driver data found\n");
indio_dev = devm_iio_device_alloc(dev, sizeof(*sc27xx_data));
if (!indio_dev)
@@ -879,56 +877,43 @@ static int sc27xx_adc_probe(struct platform_device *pdev)
sc27xx_data = iio_priv(indio_dev);
sc27xx_data->regmap = dev_get_regmap(dev->parent, NULL);
- if (!sc27xx_data->regmap) {
- dev_err(dev, "failed to get ADC regmap\n");
- return -ENODEV;
- }
+ if (!sc27xx_data->regmap)
+ return dev_err_probe(dev, -ENODEV, "failed to get ADC regmap\n");
ret = of_property_read_u32(np, "reg", &sc27xx_data->base);
- if (ret) {
- dev_err(dev, "failed to get ADC base address\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to get ADC base address\n");
sc27xx_data->irq = platform_get_irq(pdev, 0);
if (sc27xx_data->irq < 0)
return sc27xx_data->irq;
ret = of_hwspin_lock_get_id(np, 0);
- if (ret < 0) {
- dev_err(dev, "failed to get hwspinlock id\n");
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "failed to get hwspinlock id\n");
sc27xx_data->hwlock = devm_hwspin_lock_request_specific(dev, ret);
- if (!sc27xx_data->hwlock) {
- dev_err(dev, "failed to request hwspinlock\n");
- return -ENXIO;
- }
+ if (!sc27xx_data->hwlock)
+ return dev_err_probe(dev, -ENXIO, "failed to request hwspinlock\n");
sc27xx_data->dev = dev;
if (pdata->set_volref) {
sc27xx_data->volref = devm_regulator_get(dev, "vref");
- if (IS_ERR(sc27xx_data->volref)) {
- ret = PTR_ERR(sc27xx_data->volref);
- return dev_err_probe(dev, ret, "failed to get ADC volref\n");
- }
+ if (IS_ERR(sc27xx_data->volref))
+ return dev_err_probe(dev, PTR_ERR(sc27xx_data->volref),
+ "failed to get ADC volref\n");
}
sc27xx_data->var_data = pdata;
sc27xx_data->var_data->init_scale(sc27xx_data);
ret = sc27xx_adc_enable(sc27xx_data);
- if (ret) {
- dev_err(dev, "failed to enable ADC module\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to enable ADC module\n");
ret = devm_add_action_or_reset(dev, sc27xx_adc_disable, sc27xx_data);
- if (ret) {
- dev_err(dev, "failed to add ADC disable action\n");
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to add ADC disable action\n");
indio_dev->name = dev_name(dev);
indio_dev->modes = INDIO_DIRECT_MODE;
--
2.51.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 3/5] iio: adc: qcom-spmi-rradc: Simplify with dev_err_probe
2025-12-19 14:31 ` [PATCH 3/5] iio: adc: qcom-spmi-rradc: " Krzysztof Kozlowski
@ 2025-12-19 14:47 ` Konrad Dybcio
0 siblings, 0 replies; 11+ messages in thread
From: Konrad Dybcio @ 2025-12-19 14:47 UTC (permalink / raw)
To: Krzysztof Kozlowski, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko, Joel Stanley, Andrew Jeffery,
Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Orson Zhai,
Baolin Wang, Chunyan Zhang
Cc: linux-iio, linux-arm-kernel, linux-aspeed, linux-kernel,
linux-samsung-soc, linux-arm-msm, linux-rockchip
On 12/19/25 3:31 PM, Krzysztof Kozlowski wrote:
> Use dev_err_probe() to make error code handling simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 4/5] iio: adc: rockchip: Simplify with dev_err_probe
2025-12-19 14:31 ` [PATCH 4/5] iio: adc: rockchip: " Krzysztof Kozlowski
@ 2025-12-19 14:51 ` Shawn Lin
0 siblings, 0 replies; 11+ messages in thread
From: Shawn Lin @ 2025-12-19 14:51 UTC (permalink / raw)
To: Krzysztof Kozlowski, Jonathan Cameron, David Lechner,
Nuno Sá, Andy Shevchenko, Joel Stanley, Andrew Jeffery,
Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner, Orson Zhai,
Baolin Wang, Chunyan Zhang
Cc: shawn.lin, linux-iio, linux-arm-kernel, linux-aspeed,
linux-kernel, linux-samsung-soc, linux-arm-msm, linux-rockchip
在 2025/12/19 星期五 22:31, Krzysztof Kozlowski 写道:
> Use dev_err_probe() to make error code handling simpler and handle
> deferred probe nicely (avoid spamming logs).
>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
> 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))
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/5] iio: adc: aspeed: Simplify with dev_err_probe
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
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2025-12-21 12:04 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: David Lechner, Nuno Sá, Andy Shevchenko, Joel Stanley,
Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-iio,
linux-arm-kernel, linux-aspeed, linux-kernel, linux-samsung-soc,
linux-arm-msm, linux-rockchip
On Fri, 19 Dec 2025 15:31:50 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> 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>
Not a comment on this patch as such, but this would benefit from a local
struct device *dev
> ---
> drivers/iio/adc/aspeed_adc.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
> index bf2bfd6bdc41..1ae45fe90e6c 100644
> --- a/drivers/iio/adc/aspeed_adc.c
> +++ b/drivers/iio/adc/aspeed_adc.c
> @@ -535,11 +535,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
> return PTR_ERR(data->clk_scaler);
>
> data->rst = devm_reset_control_get_shared(&pdev->dev, NULL);
> - if (IS_ERR(data->rst)) {
> - dev_err(&pdev->dev,
> - "invalid or missing reset controller device tree entry");
> - return PTR_ERR(data->rst);
> - }
> + if (IS_ERR(data->rst))
> + return dev_err_probe(&pdev->dev, PTR_ERR(data->rst),
> + "invalid or missing reset controller device tree entry");
> +
> reset_control_deassert(data->rst);
>
> ret = devm_add_action_or_reset(data->dev, aspeed_adc_reset_assert,
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/5] iio: adc: Simplify with dev_err_probe
2025-12-19 14:31 [PATCH 0/5] iio: adc: Simplify with dev_err_probe Krzysztof Kozlowski
` (4 preceding siblings ...)
2025-12-19 14:31 ` [PATCH 5/5] iio: adc: sc27xx: " Krzysztof Kozlowski
@ 2025-12-21 12:04 ` Jonathan Cameron
5 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2025-12-21 12:04 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: David Lechner, Nuno Sá, Andy Shevchenko, Joel Stanley,
Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-iio,
linux-arm-kernel, linux-aspeed, linux-kernel, linux-samsung-soc,
linux-arm-msm, linux-rockchip
On Fri, 19 Dec 2025 15:31:49 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:
> Use dev_err_probe() to make error code handling simpler and handle
> deferred probe nicely (avoid spamming logs).
>
> Best regards,
> Krzysztof
Thanks. Series applied.
Jonathan
>
> ---
> Krzysztof Kozlowski (5):
> iio: adc: aspeed: Simplify with dev_err_probe
> iio: adc: exynos: Simplify with dev_err_probe
> iio: adc: qcom-spmi-rradc: Simplify with dev_err_probe
> iio: adc: rockchip: Simplify with dev_err_probe
> iio: adc: sc27xx: Simplify with dev_err_probe
>
> drivers/iio/adc/aspeed_adc.c | 9 ++++---
> drivers/iio/adc/exynos_adc.c | 29 ++++++++---------------
> drivers/iio/adc/qcom-spmi-rradc.c | 20 ++++++----------
> drivers/iio/adc/rockchip_saradc.c | 13 ++++-------
> drivers/iio/adc/sc27xx_adc.c | 49 ++++++++++++++-------------------------
> 5 files changed, 43 insertions(+), 77 deletions(-)
> ---
> base-commit: cc3aa43b44bdb43dfbac0fcb51c56594a11338a8
> change-id: 20251219-iio-dev-err-probe-59b3104c8d4b
>
> Best regards,
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/5] iio: adc: aspeed: Simplify with dev_err_probe
2025-12-21 12:04 ` Jonathan Cameron
@ 2025-12-21 14:05 ` Krzysztof Kozlowski
0 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-12-21 14:05 UTC (permalink / raw)
To: Jonathan Cameron
Cc: David Lechner, Nuno Sá, Andy Shevchenko, Joel Stanley,
Andrew Jeffery, Krzysztof Kozlowski, Alim Akhtar, Heiko Stuebner,
Orson Zhai, Baolin Wang, Chunyan Zhang, linux-iio,
linux-arm-kernel, linux-aspeed, linux-kernel, linux-samsung-soc,
linux-arm-msm, linux-rockchip
On 21/12/2025 13:04, Jonathan Cameron wrote:
> On Fri, 19 Dec 2025 15:31:50 +0100
> Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> wrote:
>
>> 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>
> Not a comment on this patch as such, but this would benefit from a local
> struct device *dev
Ack
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-12-21 14:05 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox