aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/fm
diff options
context:
space:
mode:
authorSimon Glass2020-12-22 19:30:28 -0700
committerSimon Glass2021-01-05 12:24:40 -0700
commit0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch)
tree1dbc5b936b98393e343cc99a40382b2734ac778e /drivers/net/fm
parent12559f5bab3e43b603dccfa6c354ffd7da03249c (diff)
dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/net/fm')
-rw-r--r--drivers/net/fm/eth.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c
index 02ccf1efc3b..a10f87eefc5 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);
@@ -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;