All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe()
@ 2021-09-28 14:19 ` Cai Huoqing
  0 siblings, 0 replies; 68+ messages in thread
From: Cai Huoqing @ 2021-09-28 14:19 UTC (permalink / raw)
  To: caihuoqing
  Cc: Linus Walleij, Jonathan Cameron, Lars-Peter Clausen, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Vladimir Zapolskiy, Neil Armstrong, Kevin Hilman,
	Jerome Brunet, Martin Blumenstingl, Andy Gross, Bjorn Andersson,
	Heiko Stuebner, linux-arm-kernel, linux-iio, linux-kernel,
	linux-amlogic, linux-arm-msm, linux-rockchip

When possible use dev_err_probe help to properly deal with the
PROBE_DEFER error, the benefit is that DEFER issue will be logged
in the devices_deferred debugfs file.
Using dev_err_probe() can reduce code size, and the error value
gets printed.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
v1->v2: Remove the separate line of PTR_ERR().

 drivers/iio/adc/ab8500-gpadc.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/ab8500-gpadc.c b/drivers/iio/adc/ab8500-gpadc.c
index 7b5212ba5501..c58d0e2ae538 100644
--- a/drivers/iio/adc/ab8500-gpadc.c
+++ b/drivers/iio/adc/ab8500-gpadc.c
@@ -1146,11 +1146,9 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
 
 	/* The VTVout LDO used to power the AB8500 GPADC */
 	gpadc->vddadc = devm_regulator_get(dev, "vddadc");
-	if (IS_ERR(gpadc->vddadc)) {
-		ret = PTR_ERR(gpadc->vddadc);
-		dev_err(dev, "failed to get vddadc\n");
-		return ret;
-	}
+	if (IS_ERR(gpadc->vddadc))
+		return dev_err_probe(dev, PTR_ERR(gpadc->vddadc),
+				     "failed to get vddadc\n");
 
 	ret = regulator_enable(gpadc->vddadc);
 	if (ret) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 68+ messages in thread

end of thread, other threads:[~2021-10-02 17:10 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 14:19 [PATCH v3 1/9] iio: adc: ab8500-gpadc: Make use of the helper function dev_err_probe() Cai Huoqing
2021-09-28 14:19 ` Cai Huoqing
2021-09-28 14:19 ` Cai Huoqing
2021-09-28 14:19 ` Cai Huoqing
2021-09-28 14:19 ` [PATCH v3 2/9] iio: adc: imx7d_adc: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-29 16:26   ` Jonathan Cameron
2021-09-29 16:26     ` Jonathan Cameron
2021-09-29 16:26     ` Jonathan Cameron
2021-09-29 16:26     ` Jonathan Cameron
2021-09-28 14:19 ` [PATCH v3 3/9] iio: adc: lpc18xx_adc: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19 ` [PATCH v3 4/9] iio: adc: max1118: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19 ` [PATCH v3 5/9] iio: adc: max1241: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-29 16:40   ` Jonathan Cameron
2021-09-29 16:40     ` Jonathan Cameron
2021-09-29 16:40     ` Jonathan Cameron
2021-09-29 16:40     ` Jonathan Cameron
2021-09-28 14:19 ` [PATCH v3 6/9] iio: adc: meson_saradc: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-10-02 13:01   ` Martin Blumenstingl
2021-10-02 13:01     ` Martin Blumenstingl
2021-10-02 13:01     ` Martin Blumenstingl
2021-10-02 13:01     ` Martin Blumenstingl
2021-10-02 16:09     ` Jonathan Cameron
2021-10-02 16:09       ` Jonathan Cameron
2021-10-02 16:09       ` Jonathan Cameron
2021-10-02 16:09       ` Jonathan Cameron
2021-10-02 17:06       ` Martin Blumenstingl
2021-10-02 17:06         ` Martin Blumenstingl
2021-10-02 17:06         ` Martin Blumenstingl
2021-10-02 17:06         ` Martin Blumenstingl
2021-09-28 14:19 ` [PATCH v3 7/9] iio: adc: qcom-pm8xxx-xoadc: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:30   ` Linus Walleij
2021-09-28 14:30     ` Linus Walleij
2021-09-28 14:30     ` Linus Walleij
2021-09-28 14:30     ` Linus Walleij
2021-09-28 14:19 ` [PATCH v3 8/9] iio: adc: rockchip_saradc: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-29 16:55   ` Jonathan Cameron
2021-09-29 16:55     ` Jonathan Cameron
2021-09-29 16:55     ` Jonathan Cameron
2021-09-29 16:55     ` Jonathan Cameron
2021-09-28 14:19 ` [PATCH v3 9/9] iio: adc: ti-ads7950: " Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-28 14:19   ` Cai Huoqing
2021-09-29 16:20 ` [PATCH v3 1/9] iio: adc: ab8500-gpadc: " Jonathan Cameron
2021-09-29 16:20   ` Jonathan Cameron
2021-09-29 16:20   ` Jonathan Cameron
2021-09-29 16:20   ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.