[PATCH 1/3] net: designware: don't depend on CONFIG_OFTREE

Lucas Stach dev at lynxeye.de
Sun Mar 1 13:06:35 PST 2015


This driver is written in a way that is should also work without
DT, but it had a compile time dependency on CONFIG_OFTREE.

Fixes:
drivers/built-in.o: In function `dwc_probe_dt':
drivers/net/designware.c:413: undefined reference to `of_get_phy_mode'

Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 drivers/net/designware.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 49ed0b192231..29a6047c7f1a 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -406,6 +406,9 @@ static void dwc_version(struct device_d *dev, u32 hwid)
 
 static int dwc_probe_dt(struct device_d *dev, struct dw_eth_dev *priv)
 {
+	if (!IS_ENABLED(CONFIG_OFTREE))
+		return -ENODEV;
+
 	priv->phy_addr = -1;
 	priv->interface = of_get_phy_mode(dev->device_node);
 
-- 
2.1.0




More information about the barebox mailing list