diff options
Diffstat (limited to 'drivers/net/fm/eth.c')
-rw-r--r-- | drivers/net/fm/eth.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index 02ccf1efc3b..0e89e663f71 100644 --- a/drivers/net/fm/eth.c +++ b/drivers/net/fm/eth.c @@ -547,7 +547,11 @@ static void fm_eth_halt(struct udevice *dev) struct fm_eth *fm_eth; struct fsl_enet_mac *mac; +#ifndef CONFIG_DM_ETH fm_eth = (struct fm_eth *)dev->priv; +#else + fm_eth = dev_get_priv(dev); +#endif mac = fm_eth->mac; /* graceful stop the transmission of frames */ @@ -577,7 +581,11 @@ static int fm_eth_send(struct udevice *dev, void *buf, int len) u16 offset_in; int i; +#ifndef CONFIG_DM_ETH fm_eth = (struct fm_eth *)dev->priv; +#else + fm_eth = dev_get_priv(dev); +#endif pram = fm_eth->tx_pram; txbd = fm_eth->cur_txbd; @@ -664,13 +672,19 @@ static int fm_eth_recv(struct eth_device *dev) static int fm_eth_recv(struct udevice *dev, int flags, uchar **packetp) #endif { - struct fm_eth *fm_eth = (struct fm_eth *)dev->priv; - struct fm_port_bd *rxbd = fm_eth->cur_rxbd; + struct fm_eth *fm_eth; + struct fm_port_bd *rxbd; u32 buf_lo, buf_hi; u16 status, len; int ret = -1; u8 *data; +#ifndef CONFIG_DM_ETH + fm_eth = (struct fm_eth *)dev->priv; +#else + fm_eth = dev_get_priv(dev); +#endif + rxbd = fm_eth->cur_rxbd; status = muram_readw(&rxbd->status); while (!(status & RxBD_EMPTY)) { @@ -704,7 +718,7 @@ static int fm_eth_recv(struct udevice *dev, int flags, uchar **packetp) #ifdef CONFIG_DM_ETH static int fm_eth_free_pkt(struct udevice *dev, uchar *packet, int length) { - struct fm_eth *fm_eth = (struct fm_eth *)dev->priv; + struct fm_eth *fm_eth = (struct fm_eth *)dev_get_priv(dev); fm_eth->cur_rxbd = fm_eth_free_one(fm_eth, fm_eth->cur_rxbd); @@ -943,7 +957,7 @@ phy_interface_t fman_read_sys_if(struct udevice *dev) { const char *if_str; - if_str = ofnode_read_string(dev->node, "phy-connection-type"); + if_str = ofnode_read_string(dev_ofnode(dev), "phy-connection-type"); debug("MAC system interface mode %s\n", if_str); return phy_get_interface_by_name(if_str); @@ -955,7 +969,7 @@ static int fm_eth_bind(struct udevice *dev) char mac_name[11]; u32 fm, num; - if (ofnode_read_u32(ofnode_get_parent(dev->node), "cell-index", &fm)) { + if (ofnode_read_u32(ofnode_get_parent(dev_ofnode(dev)), "cell-index", &fm)) { printf("FMan node property cell-index missing\n"); return -EINVAL; } @@ -1004,7 +1018,7 @@ static struct udevice *fm_get_internal_mdio(struct udevice *dev) static int fm_eth_probe(struct udevice *dev) { - struct fm_eth *fm_eth = (struct fm_eth *)dev->priv; + struct fm_eth *fm_eth = (struct fm_eth *)dev_get_priv(dev); struct ofnode_phandle_args args; void *reg; int ret, index; |