Skip to contentSkip to conversation

net: phy: micrel: don't do clock-mode-select if we got NULL clock

PATCH In review Niklas Cassel 2 participants 2 messages Apr 23, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: micrel: don't do clock-mode-select if we got NULL clock

---
 drivers/net/phy/micrel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/micrel.c +1 -1
index 1190fd8..a422036 100644
@@ -548,7 +548,7 @@ static int kszphy_probe(struct phy_device *phydev)
 	}
 
 	clk = devm_clk_get(&phydev->dev, "rmii-ref");
-	if (!IS_ERR(clk)) {
+	if (!IS_ERR_OR_NULL(clk)) {
 		unsigned long rate = clk_get_rate(clk);
 		bool rmii_ref_clk_sel_25_mhz;
 
Signature · 1 line
2.1.4
maintainer
#1 lore raw

From: Niklas Cassel <[email protected]>
Date: Thu, 23 Apr 2015 15:37:11 +0200

Quoted 10 lines
---
 drivers/net/phy/micrel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/micrel.c +0 -0
index 1190fd8..a422036 100644

drivers/net/phy/micrel.c static int kszphy_probe(struct phy_device *phydev) · line 554

Quoted 8 lines
drivers/net/phy/micrel.c +1 -1
@@ -548,7 +548,7 @@ static int kszphy_probe(struct phy_device *phydev)
 	}
 
 	clk = devm_clk_get(&phydev->dev, "rmii-ref");
-	if (!IS_ERR(clk)) {
+	if (!IS_ERR_OR_NULL(clk)) {
 		unsigned long rate = clk_get_rate(clk);
 		bool rmii_ref_clk_sel_25_mhz;
 

I do not see anyone in any other networking driver checking for a NULL return from devm_clk_get().

So either everyone else is wrong, or your change is. I want to find out which before applying anything.