aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/net/thunderx.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-09-24 21:45:03 +0100
committerMichael Brown <mcb30@ipxe.org>2020-09-25 14:17:07 +0100
commiteecb75ba4809bd5d3e6d63413a45c5fccbda2bc2 (patch)
treedcb9379c726dd4a02566c6866803fa45d7ee0649 /src/drivers/net/thunderx.c
parent371af4eef2dfa1facf6645a5704d8a55ff45c965 (diff)
downloadipxe-eecb75ba4809bd5d3e6d63413a45c5fccbda2bc2.tar.gz
[pci] Update drivers to use pci_ioremap()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/net/thunderx.c')
-rw-r--r--src/drivers/net/thunderx.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/drivers/net/thunderx.c b/src/drivers/net/thunderx.c
index 9ddb98ab8..1865a9b91 100644
--- a/src/drivers/net/thunderx.c
+++ b/src/drivers/net/thunderx.c
@@ -645,11 +645,11 @@ static void txnic_poll ( struct txnic *vnic ) {
/**
* Allocate virtual NIC
*
- * @v dev Underlying device
+ * @v pci Underlying PCI device
* @v membase Register base address
* @ret vnic Virtual NIC, or NULL on failure
*/
-static struct txnic * txnic_alloc ( struct device *dev,
+static struct txnic * txnic_alloc ( struct pci_device *pci,
unsigned long membase ) {
struct net_device *netdev;
struct txnic *vnic;
@@ -658,10 +658,10 @@ static struct txnic * txnic_alloc ( struct device *dev,
netdev = alloc_etherdev ( sizeof ( *vnic ) );
if ( ! netdev )
goto err_alloc_netdev;
- netdev->dev = dev;
+ netdev->dev = &pci->dev;
vnic = netdev->priv;
vnic->netdev = netdev;
- vnic->name = dev->name;
+ vnic->name = pci->dev.name;
/* Allow caller to reuse netdev->priv. (The generic virtual
* NIC code never assumes that netdev->priv==vnic.)
@@ -684,7 +684,7 @@ static struct txnic * txnic_alloc ( struct device *dev,
goto err_alloc_rq;
/* Map registers */
- vnic->regs = ioremap ( membase, TXNIC_VF_BAR_SIZE );
+ vnic->regs = pci_ioremap ( pci, membase, TXNIC_VF_BAR_SIZE );
if ( ! vnic->regs )
goto err_ioremap;
@@ -1103,7 +1103,7 @@ static int txnic_lmac_probe ( struct txnic_lmac *lmac ) {
membase = ( pf->vf_membase + ( lmac->idx * pf->vf_stride ) );
/* Allocate and initialise network device */
- vnic = txnic_alloc ( &bgx->pci->dev, membase );
+ vnic = txnic_alloc ( bgx->pci, membase );
if ( ! vnic ) {
rc = -ENOMEM;
goto err_alloc;
@@ -1275,7 +1275,7 @@ static int txnic_pf_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
- pf->regs = ioremap ( membase, TXNIC_PF_BAR_SIZE );
+ pf->regs = pci_ioremap ( pci, membase, TXNIC_PF_BAR_SIZE );
if ( ! pf->regs ) {
rc = -ENODEV;
goto err_ioremap;
@@ -1633,7 +1633,7 @@ static int txnic_bgx_probe ( struct pci_device *pci ) {
adjust_pci_device ( pci );
/* Map registers */
- bgx->regs = ioremap ( membase, TXNIC_BGX_BAR_SIZE );
+ bgx->regs = pci_ioremap ( pci, membase, TXNIC_BGX_BAR_SIZE );
if ( ! bgx->regs ) {
rc = -ENODEV;
goto err_ioremap;