[PATCH] phy: use IS_ERR_OR_NULL() helper in of_phy_put()
From: Yang Xiuwei
Date: Thu Aug 14 2025 - 01:38:38 EST
From: Yang Xiuwei <yangxiuwei@xxxxxxxxxx>
The current check for `!phy || IS_ERR(phy)` can be simplified to
the standard helper macro IS_ERR_OR_NULL(). This improves code
readability and maintains consistency with kernel coding practices.
Signed-off-by: Yang Xiuwei <yangxiuwei@xxxxxxxxxx>
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 04a5a34e7a95..9248f2249849 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -677,7 +677,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.25.1