[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250814053742.2186419-1-yangxiuwei2025@163.com>
Date: Thu, 14 Aug 2025 13:37:42 +0800
From: Yang Xiuwei <yangxiuwei2025@....com>
To: vkoul@...nel.org,
kishon@...nel.org
Cc: linux-phy@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Yang Xiuwei <yangxiuwei@...inos.cn>
Subject: [PATCH] phy: use IS_ERR_OR_NULL() helper in of_phy_put()
From: Yang Xiuwei <yangxiuwei@...inos.cn>
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@...inos.cn>
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
Powered by blists - more mailing lists