summaryrefslogtreecommitdiff
path: root/drivers/net/phy/xilinx_phy.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-07-26 15:55:42 -0400
committerTom Rini <trini@konsulko.com>2018-07-26 15:55:42 -0400
commita57d45db90c8de2959b4484cc8f6ba81219a2269 (patch)
tree0f4bb63c28f89aea45db67d82bf53de87d930e44 /drivers/net/phy/xilinx_phy.c
parent2547e91dc15e5203e15d4ebde9172174743b14a7 (diff)
parent26026e695afa794ac018a09e79a48120d322b60d (diff)
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'drivers/net/phy/xilinx_phy.c')
-rw-r--r--drivers/net/phy/xilinx_phy.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/phy/xilinx_phy.c b/drivers/net/phy/xilinx_phy.c
index 004cfcf6472..3aa8891efe4 100644
--- a/drivers/net/phy/xilinx_phy.c
+++ b/drivers/net/phy/xilinx_phy.c
@@ -10,8 +10,6 @@
#include <phy.h>
#include <dm.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#define MII_PHY_STATUS_SPD_MASK 0x0C00
#define MII_PHY_STATUS_FULLDUPLEX 0x1000
#define MII_PHY_STATUS_1000 0x0800
@@ -101,10 +99,14 @@ static int xilinxphy_startup(struct phy_device *phydev)
static int xilinxphy_of_init(struct phy_device *phydev)
{
u32 phytype;
+ ofnode node;
debug("%s\n", __func__);
- phytype = fdtdec_get_int(gd->fdt_blob, dev_of_offset(phydev->dev),
- "xlnx,phy-type", -1);
+ node = phy_get_ofnode(phydev);
+ if (!ofnode_valid(node))
+ return -EINVAL;
+
+ phytype = ofnode_read_u32_default(node, "xlnx,phy-type", -1);
if (phytype == XAE_PHY_TYPE_1000BASE_X)
phydev->flags |= XAE_PHY_TYPE_1000BASE_X;