[PATCH 2/6] macb: fix clock probing with DT

Sam Ravnborg sam at ravnborg.org
Wed Jul 19 14:21:00 PDT 2017


With DT enabled the following was logged:

   macb fffbc000.ethernet: no macb_clk
   macb fffbc000.ethernet: probe failed: Invalid argument

The clock probed was with the name used in a non-DT setup.
Fix so we use a proper name ("pclk") with DT, and keep
current fuctionality without DT.

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Acked-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 drivers/net/macb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 739a3dfbe..7721bcb56 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -666,7 +666,7 @@ static int macb_probe(struct device_d *dev)
 			macb->miibus.dev.device_node = mdiobus;
 
 		macb->phy_addr = -1;
-		pclk_name = NULL;
+		pclk_name = "pclk";
 	} else {
 		dev_err(dev, "macb: no platform_data\n");
 		return -ENODEV;
@@ -681,7 +681,7 @@ static int macb_probe(struct device_d *dev)
 	 * Do some basic initialization so that we at least can talk
 	 * to the PHY
 	 */
-	macb->pclk = clk_get(dev, "macb_clk");
+	macb->pclk = clk_get(dev, pclk_name);
 	if (IS_ERR(macb->pclk)) {
 		dev_err(dev, "no macb_clk\n");
 		return PTR_ERR(macb->pclk);
-- 
2.12.0




More information about the barebox mailing list