[PATCH 40/61] phy: Prefer IS_ERR_OR_NULL over manual NULL check
Philipp Hahn
phahn-oss at avm.de
Tue Mar 10 04:49:06 PDT 2026
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.
Change generated with coccinelle.
To: Vinod Koul <vkoul at kernel.org>
To: Neil Armstrong <neil.armstrong at linaro.org>
Cc: linux-phy at lists.infradead.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
---
drivers/phy/phy-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 21aaf2f76e53eb1c63f1ffd2217f767c2dab5c3a..6416e9097caab56f7ba663777eba2c06291dffc5 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -699,7 +699,7 @@ EXPORT_SYMBOL_GPL(of_phy_get);
*/
void of_phy_put(struct phy *phy)
{
- if (!phy || IS_ERR(phy))
+ if (IS_ERR_OR_NULL(phy))
return;
mutex_lock(&phy->mutex);
--
2.43.0
More information about the Linux-rockchip
mailing list