summaryrefslogtreecommitdiff
path: root/drivers/net/xilinx_axi_emac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/xilinx_axi_emac.c')
-rw-r--r--drivers/net/xilinx_axi_emac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index d48e342ea08..5f5bc650bef 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -11,6 +11,7 @@
#include <cpu_func.h>
#include <display_options.h>
#include <dm.h>
+#include <dm/device_compat.h>
#include <log.h>
#include <net.h>
#include <malloc.h>
@@ -317,6 +318,10 @@ static int axiemac_phy_init(struct udevice *dev)
/* Interface - look at tsec */
phydev = phy_connect(priv->bus, priv->phyaddr, dev, priv->interface);
+ if (IS_ERR_OR_NULL(phydev)) {
+ dev_err(dev, "phy_connect() failed\n");
+ return -ENODEV;
+ }
phydev->supported &= supported;
phydev->advertising = phydev->supported;