diff options
author | Michael Brown <mcb30@ipxe.org> | 2023-09-13 14:30:25 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2023-09-13 16:29:48 +0100 |
commit | eeb7cd56e54e2bc649626988872c170fba37c163 (patch) | |
tree | dfc1a3ee5ca1bc46ae23128bbcd2d0b832967a35 /src/drivers/net/phantom | |
parent | 0aa2e4ec963597794dd8f8b36f77f4d0cf4e03c8 (diff) | |
download | ipxe-eeb7cd56e54e2bc649626988872c170fba37c163.tar.gz |
[netdevice] Remove netdev_priv() helper function
Some network device drivers use the trivial netdev_priv() helper
function while others use the netdev->priv pointer directly.
Standardise on direct use of netdev->priv, in order to free up the
function name netdev_priv() for reuse.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/phantom')
-rw-r--r-- | src/drivers/net/phantom/phantom.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/drivers/net/phantom/phantom.c b/src/drivers/net/phantom/phantom.c index 843459059..e5fd1f31f 100644 --- a/src/drivers/net/phantom/phantom.c +++ b/src/drivers/net/phantom/phantom.c @@ -1062,7 +1062,7 @@ static inline int phantom_del_macaddr ( struct phantom_nic *phantom, * @v netdev Network device */ static void phantom_poll_link_state ( struct net_device *netdev ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; uint32_t xg_state_p3; unsigned int link; @@ -1109,7 +1109,7 @@ static void phantom_poll_link_state ( struct net_device *netdev ) { * @v netdev Net device */ static void phantom_refill_rx_ring ( struct net_device *netdev ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; struct io_buffer *iobuf; struct phantom_rds rds; unsigned int handle; @@ -1160,7 +1160,7 @@ static void phantom_refill_rx_ring ( struct net_device *netdev ) { * @ret rc Return status code */ static int phantom_open ( struct net_device *netdev ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; int rc; /* Allocate and zero descriptor rings */ @@ -1220,7 +1220,7 @@ static int phantom_open ( struct net_device *netdev ) { * @v netdev Net device */ static void phantom_close ( struct net_device *netdev ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; struct io_buffer *iobuf; unsigned int i; @@ -1258,7 +1258,7 @@ static void phantom_close ( struct net_device *netdev ) { */ static int phantom_transmit ( struct net_device *netdev, struct io_buffer *iobuf ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; union phantom_cds cds; int index; @@ -1297,7 +1297,7 @@ static int phantom_transmit ( struct net_device *netdev, * @v netdev Network device */ static void phantom_poll ( struct net_device *netdev ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; struct io_buffer *iobuf; unsigned int irq_vector; unsigned int irq_state; @@ -1434,7 +1434,7 @@ static void phantom_poll ( struct net_device *netdev ) { * @v enable Interrupts should be enabled */ static void phantom_irq ( struct net_device *netdev, int enable ) { - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; phantom_writel ( phantom, ( enable ? 1 : 0 ), phantom->sds_irq_mask_crb ); @@ -2070,7 +2070,7 @@ static int phantom_probe ( struct pci_device *pci ) { goto err_alloc_etherdev; } netdev_init ( netdev, &phantom_operations ); - phantom = netdev_priv ( netdev ); + phantom = netdev->priv; pci_set_drvdata ( pci, netdev ); netdev->dev = &pci->dev; memset ( phantom, 0, sizeof ( *phantom ) ); @@ -2161,7 +2161,7 @@ static int phantom_probe ( struct pci_device *pci ) { */ static void phantom_remove ( struct pci_device *pci ) { struct net_device *netdev = pci_get_drvdata ( pci ); - struct phantom_nic *phantom = netdev_priv ( netdev ); + struct phantom_nic *phantom = netdev->priv; unregister_settings ( &phantom->settings ); unregister_netdev ( netdev ); |