iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled()
Subsystems (3)
PATCH 1/2 iio: adc: ti-ads131m02: Drop redundant NULL check on devm_clk_get_enabled()
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().
--- drivers/iio/adc/ti-ads131m02.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/iio/adc/ti-ads131m02.c +2 -8
@@ -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 )
Signature · 1 line
2.53.0
PATCH 2/2 iio: adc: ade9000: Drop incorrect kerneldoc marker
Top-level comment is not a kerneldoc, so drop marker to fix W=1 warning:
drivers/iio/adc/ade9000.c:2 This comment starts with '/**', but isn't a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst
--- drivers/iio/adc/ade9000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/ade9000.c +1 -1
@@ -1,5 +1,5 @@// SPDX-License-Identifier: GPL-2.0-only -/** +/* * ADE9000 driver * * Copyright 2025 Analog Devices Inc.
Signature · 1 line
2.53.0
Re: [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker
Quoted 7 lines · Krzysztof Kozlowski
Top-level comment is not a kerneldoc, so drop marker to fix W=1 warning:
drivers/iio/adc/ade9000.c:2This comment starts with '/**', but isn't a kernel-doc comment. Refer toDocumentation/doc-guide/kernel-doc.rstSigned-off-by Krzysztof Kozlowski <[email protected]>---
Signature · 3 lines
Kind regards CJD
Re: [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker
In reply to Krzysztof KozlowskiQuoted 9 lines · CDT Krzysztof Kozlowski
Top-level comment is not a kerneldoc, so drop marker to fix W=1 warning:
drivers/iio/adc/ade9000.c:2This comment starts with '/**', but isn't a kernel-doc comment. Refer toDocumentation/doc-guide/kernel-doc.rstSigned-off-by Krzysztof Kozlowski <[email protected]>--- drivers/iio/adc/ade9000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 2 lines
best regards, max
Re: [PATCH 2/2] iio: adc: ade9000: Drop incorrect kerneldoc marker
Quoted 7 lines · On Sun, 05 Jul 2026 12:50:28 -0500 "Maxwell Doose" <[email protected]> wrote:
Quoted 4 lines · CDT Krzysztof Kozlowski
Top-level comment is not a kerneldoc, so drop marker to fix W=1 warning:
drivers/iio/adc/ade9000.c:2This comment starts with '/**', but isn't a kernel-doc comment. Refer toDocumentation/doc-guide/kernel-doc.rst
Quoted 8 lines
Quoted 5 lines
Signed-off-by Krzysztof Kozlowski <[email protected]>--- drivers/iio/adc/ade9000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Reviewed-by Maxwell Doose <[email protected]>
Applied.
Quoted 6 lines · Krzysztof Kozlowski
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>---
LGTM.
Signature · 3 lines
Kind regards CJD
Jonathan Cameron
maintainerQuoted 4 lines · On Sun, 5 Jul 2026 19:24:39 +0200 Krzysztof Kozlowski…
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>
See the stub.
static inline struct clk *devm_clk_get_enabled(struct device *dev,
const char *id)
{
return NULL;
}Not sure what the reasoning behind that is. Maybe that clock could be already on?
We could I guess make this driver depend on one of the clk related configs, but today it doesn't. So to me this NULL check smells of protection we don't need so I think the change is fine, but the patch description should reflect that stub and it being considered reasonable to plough on regardless.
Jonathan
Quoted 25 lines
--- drivers/iio/adc/ti-ads131m02.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/iio/adc/ti-ads131m02.c +2
-8@@ -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 )
Quoted 14 lines · Jonathan Cameron
Quoted 4 lines · On Sun, 5 Jul 2026 19:24:39 +0200 Krzysztof Kozlowski…
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>See the stub.
static inline struct clk *devm_clk_get_enabled(struct device *dev,
const char *id){ return NULL; }
Quoted 8 lines
Not sure what the reasoning behind that is. Maybe that clock could be already on?
We could I guess make this driver depend on one of the clk related configs, but today it doesn't. So to me this NULL check smells of protection we don't need so I think the change is fine, but the patch description should reflect that stub and it being considered reasonable to plough on regardless.
Oh, I missed the stub. Stub is wrong and should be fixed (and then this patch makes more sense).
Best regards,
Krzysztof
Quoted 14 lines · Jonathan Cameron
Quoted 4 lines · On Sun, 5 Jul 2026 19:24:39 +0200 Krzysztof Kozlowski…
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>See the stub.
static inline struct clk *devm_clk_get_enabled(struct device *dev,
const char *id){ return NULL; }
Quoted 8 lines
Not sure what the reasoning behind that is. Maybe that clock could be already on?
We could I guess make this driver depend on one of the clk related configs, but today it doesn't. So to me this NULL check smells of protection we don't need so I think the change is fine, but the patch description should reflect that stub and it being considered reasonable to plough on regardless.
Ah, good catch! I have thought for a moment about this possibility, but I gave tag anyway as the stub thingy should be addressed separately anyway as there are many drivers (I think) that do not check for NULL.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 24 lines · Andy Shevchenko
Quoted 14 lines · Jonathan Cameron
Quoted 4 lines · On Sun, 5 Jul 2026 19:24:39 +0200 Krzysztof Kozlowski…
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>See the stub.
static inline struct clk *devm_clk_get_enabled(struct device *dev,
const char *id){ return NULL; }Quoted 8 lines
Not sure what the reasoning behind that is. Maybe that clock could be already on?
We could I guess make this driver depend on one of the clk related configs, but today it doesn't. So to me this NULL check smells of protection we don't need so I think the change is fine, but the patch description should reflect that stub and it being considered reasonable to plough on regardless.
Quoted 3 lines
Ah, good catch! I have thought for a moment about this possibility, but I gave tag anyway as the stub thingy should be addressed separately anyway as there are many drivers (I think) that do not check for NULL.
Except these ~8 cases I found (I sent a bunch of patches), no one checks for NULL...
Best regards,
Krzysztof
Quoted 25 lines · Krzysztof Kozlowski
Quoted 24 lines · Andy Shevchenko
Quoted 22 lines · Jonathan Cameron
Quoted 4 lines · On Sun, 5 Jul 2026 19:24:39 +0200 Krzysztof Kozlowski…
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().Signed-off-by Krzysztof Kozlowski <[email protected]>See the stub.
static inline struct clk *devm_clk_get_enabled(struct device *dev,
const char *id){ return NULL; }Not sure what the reasoning behind that is. Maybe that clock could be already on?
We could I guess make this driver depend on one of the clk related configs, but today it doesn't. So to me this NULL check smells of protection we don't need so I think the change is fine, but the patch description should reflect that stub and it being considered reasonable to plough on regardless.
Quoted 6 lines
Quoted 3 lines
Ah, good catch! I have thought for a moment about this possibility, but I gave tag anyway as the stub thingy should be addressed separately anyway as there are many drivers (I think) that do not check for NULL.
Except these ~8 cases I found (I sent a bunch of patches), no one checks for NULL...
Thanks for confirming. So, I think this patch is good to go (maybe with the updated commit message), but the stub perhaps should also be addressed at some point somehow.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 2 lines · Krzysztof Kozlowski
devm_clk_get_enabled()does not return NULL (only valid clock or ERR pointer), so simplify the code to drop redundantIS_ERR_OR_NULL().
Signature · 2 lines
With Best Regards, Andy Shevchenko