summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-19 20:40:14 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:24:41 +0300
commitf10643cf8a4ca006d1ad194e930cd292fd869d17 (patch)
tree66cd9383fc5dbd8e02f999d1db5562995f441b21 /net
parent7d14ee443ca674314e0fe5c3e25f48e52a8fd5ee (diff)
downloadu-boot-f10643cf8a4ca006d1ad194e930cd292fd869d17.tar.xz
dm: core: Access device ofnode through functions
At present ofnode is present in the device even if it is never used. With of-platdata this field is not used, so can be removed. In preparation for this, change the access to go through inline functions. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r--net/mdio-mux-uclass.c2
-rw-r--r--net/mdio-uclass.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/net/mdio-mux-uclass.c b/net/mdio-mux-uclass.c
index 5f38f9fde4..780526c19e 100644
--- a/net/mdio-mux-uclass.c
+++ b/net/mdio-mux-uclass.c
@@ -163,7 +163,7 @@ static int dm_mdio_mux_post_bind(struct udevice *mux)
ofnode ch_node;
int err, first_err = 0;
- if (!ofnode_valid(mux->node)) {
+ if (!dev_has_ofnode(mux)) {
debug("%s: no mux node found, no child MDIO busses set up\n",
__func__);
return 0;
diff --git a/net/mdio-uclass.c b/net/mdio-uclass.c
index d062382c2a..697e5f838d 100644
--- a/net/mdio-uclass.c
+++ b/net/mdio-uclass.c
@@ -40,8 +40,8 @@ static int dm_mdio_post_bind(struct udevice *dev)
const char *dt_name;
/* set a custom name for the MDIO device, if present in DT */
- if (ofnode_valid(dev->node)) {
- dt_name = ofnode_read_string(dev->node, "device-name");
+ if (dev_has_ofnode(dev)) {
+ dt_name = dev_read_string(dev, "device-name");
if (dt_name) {
debug("renaming dev %s to %s\n", dev->name, dt_name);
device_set_name(dev, dt_name);
@@ -182,14 +182,14 @@ struct phy_device *dm_eth_phy_connect(struct udevice *ethdev)
struct phy_device *phy;
int i;
- if (!ofnode_valid(ethdev->node)) {
+ if (!dev_has_ofnode(ethdev)) {
debug("%s: supplied eth dev has no DT node!\n", ethdev->name);
return NULL;
}
interface = PHY_INTERFACE_MODE_NONE;
for (i = 0; i < PHY_MODE_STR_CNT; i++) {
- if_str = ofnode_read_string(ethdev->node, phy_mode_str[i]);
+ if_str = dev_read_string(ethdev, phy_mode_str[i]);
if (if_str) {
interface = phy_get_interface_by_name(if_str);
break;