The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled()
@ 2026-07-05 17:24 Krzysztof Kozlowski
  2026-07-05 17:24 ` [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker Krzysztof Kozlowski
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Krzysztof Kozlowski @ 2026-07-05 17:24 UTC (permalink / raw)
  To: Nuno Sá, Michael Hennerich, Antoniu Miclaus,
	Jonathan Cameron, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel
  Cc: Krzysztof Kozlowski

devm_clk_get_enabled() does not return NULL (only valid clock or ERR
pointer), so simplify the code to drop redundant IS_ERR_OR_NULL().

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
 drivers/iio/adc/ti-ads131m02.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/adc/ti-ads131m02.c b/drivers/iio/adc/ti-ads131m02.c
index 2f8f75c8216b..27c8abff216b 100644
--- a/drivers/iio/adc/ti-ads131m02.c
+++ b/drivers/iio/adc/ti-ads131m02.c
@@ -848,14 +848,8 @@ static int ads131m_parse_clock(struct ads131m_priv *priv, bool *is_xtal)
 	int ret;
 
 	clk = devm_clk_get_enabled(dev, NULL);
-	if (IS_ERR_OR_NULL(clk)) {
-		if (IS_ERR(clk))
-			ret = PTR_ERR(clk);
-		else
-			ret = -ENODEV;
-
-		return dev_err_probe(dev, ret, "clk get enabled failed\n");
-	}
+	if (IS_ERR(clk))
+		return dev_err_probe(dev, PTR_ERR(clk), "clk get enabled failed\n");
 
 	ret = device_property_match_string(dev, "clock-names", "xtal");
 	if (ret > 0)
-- 
2.53.0


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

end of thread, other threads:[~2026-07-06  7:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-05 17:24 [PATCH 1/2] iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled() Krzysztof Kozlowski
2026-07-05 17:24 ` [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker Krzysztof Kozlowski
2026-07-05 17:37   ` Joshua Crofts
2026-07-05 17:50   ` Maxwell Doose
2026-07-05 23:37     ` Jonathan Cameron
2026-07-05 17:34 ` [PATCH 1/2] iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled() Joshua Crofts
2026-07-05 23:37 ` Jonathan Cameron
2026-07-06  6:01   ` Krzysztof Kozlowski
2026-07-06  6:04   ` Andy Shevchenko
2026-07-06  6:55     ` Krzysztof Kozlowski
2026-07-06  7:03       ` Andy Shevchenko
2026-07-06  6:01 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox