[PATCH] phy: marvell: phy-mvebu-cp110-comphy: Remove unnecessary NULL check before clk_disable_unprepare()

Chen Ni posted 1 patch 1 week, 6 days ago
drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
[PATCH] phy: marvell: phy-mvebu-cp110-comphy: Remove unnecessary NULL check before clk_disable_unprepare()
Posted by Chen Ni 1 week, 6 days ago
clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.
Remove unneeded NULL check for clk here.

Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
index 71f9c14fb50d..990c0dd94ad6 100644
--- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
+++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c
@@ -984,14 +984,11 @@ static int mvebu_comphy_init_clks(struct mvebu_comphy_priv *priv)
 
 static void mvebu_comphy_disable_unprepare_clks(struct mvebu_comphy_priv *priv)
 {
-	if (priv->axi_clk)
-		clk_disable_unprepare(priv->axi_clk);
+	clk_disable_unprepare(priv->axi_clk);
 
-	if (priv->mg_core_clk)
-		clk_disable_unprepare(priv->mg_core_clk);
+	clk_disable_unprepare(priv->mg_core_clk);
 
-	if (priv->mg_domain_clk)
-		clk_disable_unprepare(priv->mg_domain_clk);
+	clk_disable_unprepare(priv->mg_domain_clk);
 }
 
 static int mvebu_comphy_probe(struct platform_device *pdev)
-- 
2.25.1
Re: [PATCH] phy: marvell: phy-mvebu-cp110-comphy: Remove unnecessary NULL check before clk_disable_unprepare()
Posted by Markus Elfring 1 week, 4 days ago
> clk_disable_unprepare() already checks NULL by using IS_ERR_OR_NULL.

This function calls further functions which perform known input parameter validation.


> Remove unneeded NULL check for clk here.

May two blank lines be omitted accordingly?

Regards,
Markus