diff options
Diffstat (limited to 'drivers/phy')
-rw-r--r-- | drivers/phy/marvell/comphy_core.c | 8 | ||||
-rw-r--r-- | drivers/phy/phy-uclass.c | 21 | ||||
-rw-r--r-- | drivers/phy/sandbox-phy.c | 3 | ||||
-rw-r--r-- | drivers/phy/ti-pipe3-phy.c | 4 |
4 files changed, 16 insertions, 20 deletions
diff --git a/drivers/phy/marvell/comphy_core.c b/drivers/phy/marvell/comphy_core.c index 596921b6c3..426db30f73 100644 --- a/drivers/phy/marvell/comphy_core.c +++ b/drivers/phy/marvell/comphy_core.c @@ -113,11 +113,11 @@ static int comphy_probe(struct udevice *dev) static int current_idx; /* Save base addresses for later use */ - chip_cfg->comphy_base_addr = (void *)dev_get_addr_index(dev, 0); + chip_cfg->comphy_base_addr = (void *)devfdt_get_addr_index(dev, 0); if (IS_ERR(chip_cfg->comphy_base_addr)) return PTR_ERR(chip_cfg->comphy_base_addr); - chip_cfg->hpipe3_base_addr = (void *)dev_get_addr_index(dev, 1); + chip_cfg->hpipe3_base_addr = (void *)devfdt_get_addr_index(dev, 1); if (IS_ERR(chip_cfg->hpipe3_base_addr)) return PTR_ERR(chip_cfg->hpipe3_base_addr); @@ -135,10 +135,10 @@ static int comphy_probe(struct udevice *dev) return -EINVAL; } - if (of_device_is_compatible(dev, "marvell,comphy-armada-3700")) + if (device_is_compatible(dev, "marvell,comphy-armada-3700")) chip_cfg->ptr_comphy_chip_init = comphy_a3700_init; - if (of_device_is_compatible(dev, "marvell,comphy-cp110")) + if (device_is_compatible(dev, "marvell,comphy-cp110")) chip_cfg->ptr_comphy_chip_init = comphy_cp110_init; /* diff --git a/drivers/phy/phy-uclass.c b/drivers/phy/phy-uclass.c index 0d8bef76db..d8b8d58e44 100644 --- a/drivers/phy/phy-uclass.c +++ b/drivers/phy/phy-uclass.c @@ -17,7 +17,7 @@ static inline struct phy_ops *phy_dev_ops(struct udevice *dev) } static int generic_phy_xlate_offs_flags(struct phy *phy, - struct fdtdec_phandle_args *args) + struct ofnode_phandle_args *args) { debug("%s(phy=%p)\n", __func__, phy); @@ -31,14 +31,13 @@ static int generic_phy_xlate_offs_flags(struct phy *phy, else phy->id = 0; - return 0; } int generic_phy_get_by_index(struct udevice *dev, int index, struct phy *phy) { - struct fdtdec_phandle_args args; + struct ofnode_phandle_args args; struct phy_ops *ops; int ret; struct udevice *phydev; @@ -46,18 +45,17 @@ int generic_phy_get_by_index(struct udevice *dev, int index, debug("%s(dev=%p, index=%d, phy=%p)\n", __func__, dev, index, phy); assert(phy); - ret = fdtdec_parse_phandle_with_args(gd->fdt_blob, dev_of_offset(dev), - "phys", "#phy-cells", 0, index, - &args); + ret = dev_read_phandle_with_args(dev, "phys", "#phy-cells", 0, index, + &args); if (ret) { - debug("%s: fdtdec_parse_phandle_with_args failed: err=%d\n", + debug("%s: dev_read_phandle_with_args failed: err=%d\n", __func__, ret); return ret; } - ret = uclass_get_device_by_of_offset(UCLASS_PHY, args.node, &phydev); + ret = uclass_get_device_by_ofnode(UCLASS_PHY, args.node, &phydev); if (ret) { - debug("%s: uclass_get_device_by_of_offset failed: err=%d\n", + debug("%s: uclass_get_device_by_ofnode failed: err=%d\n", __func__, ret); return ret; } @@ -88,10 +86,9 @@ int generic_phy_get_by_name(struct udevice *dev, const char *phy_name, debug("%s(dev=%p, name=%s, phy=%p)\n", __func__, dev, phy_name, phy); - index = fdt_stringlist_search(gd->fdt_blob, dev_of_offset(dev), - "phy-names", phy_name); + index = dev_read_stringlist_search(dev, "phy-names", phy_name); if (index < 0) { - debug("fdt_stringlist_search() failed: %d\n", index); + debug("dev_read_stringlist_search() failed: %d\n", index); return index; } diff --git a/drivers/phy/sandbox-phy.c b/drivers/phy/sandbox-phy.c index 9ad820c24c..867c6fe704 100644 --- a/drivers/phy/sandbox-phy.c +++ b/drivers/phy/sandbox-phy.c @@ -80,8 +80,7 @@ static int sandbox_phy_probe(struct udevice *dev) priv->initialized = false; priv->on = false; - priv->broken = fdtdec_get_bool(gd->fdt_blob, dev_of_offset(dev), - "broken"); + priv->broken = dev_read_bool(dev, "broken"); return 0; } diff --git a/drivers/phy/ti-pipe3-phy.c b/drivers/phy/ti-pipe3-phy.c index ed80f0ff0b..680e32f3ea 100644 --- a/drivers/phy/ti-pipe3-phy.c +++ b/drivers/phy/ti-pipe3-phy.c @@ -296,7 +296,7 @@ static void *get_reg(struct udevice *dev, const char *name) return NULL; } - cell = fdt_getprop(gd->fdt_blob, dev->of_offset, name, + cell = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), name, &len); if (len < 2*sizeof(fdt32_t)) { error("offset not available for %s\n", name); @@ -316,7 +316,7 @@ static int pipe3_phy_probe(struct udevice *dev) fdt_size_t sz; struct omap_pipe3 *pipe3 = dev_get_priv(dev); - addr = dev_get_addr_size_index(dev, 2, &sz); + addr = devfdt_get_addr_size_index(dev, 2, &sz); if (addr == FDT_ADDR_T_NONE) { error("missing pll ctrl address\n"); return -EINVAL; |