[PATCH 40/61] phy: Prefer IS_ERR_OR_NULL over manual NULL check
From: Philipp Hahn
Date: Tue Mar 10 2026 - 08:43:07 EST
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.
Change generated with coccinelle.
To: Vinod Koul <vkoul@xxxxxxxxxx>
To: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Cc: linux-phy@xxxxxxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Philipp Hahn <phahn-oss@xxxxxx>
---
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