net: phy: xilinx: switch to use phy_get_ofnode()
Use PHY API phy_get_ofnode() helper to get PHY DT node. Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
b8d7ec782f
commit
aadbd97843
|
|
@ -10,8 +10,6 @@
|
||||||
#include <phy.h>
|
#include <phy.h>
|
||||||
#include <dm.h>
|
#include <dm.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
|
||||||
|
|
||||||
#define MII_PHY_STATUS_SPD_MASK 0x0C00
|
#define MII_PHY_STATUS_SPD_MASK 0x0C00
|
||||||
#define MII_PHY_STATUS_FULLDUPLEX 0x1000
|
#define MII_PHY_STATUS_FULLDUPLEX 0x1000
|
||||||
#define MII_PHY_STATUS_1000 0x0800
|
#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)
|
static int xilinxphy_of_init(struct phy_device *phydev)
|
||||||
{
|
{
|
||||||
u32 phytype;
|
u32 phytype;
|
||||||
|
ofnode node;
|
||||||
|
|
||||||
debug("%s\n", __func__);
|
debug("%s\n", __func__);
|
||||||
phytype = fdtdec_get_int(gd->fdt_blob, dev_of_offset(phydev->dev),
|
node = phy_get_ofnode(phydev);
|
||||||
"xlnx,phy-type", -1);
|
if (!ofnode_valid(node))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
phytype = ofnode_read_u32_default(node, "xlnx,phy-type", -1);
|
||||||
if (phytype == XAE_PHY_TYPE_1000BASE_X)
|
if (phytype == XAE_PHY_TYPE_1000BASE_X)
|
||||||
phydev->flags |= XAE_PHY_TYPE_1000BASE_X;
|
phydev->flags |= XAE_PHY_TYPE_1000BASE_X;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue