diff options
Diffstat (limited to 'drivers/net/ag71xx.c')
-rw-r--r-- | drivers/net/ag71xx.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/ag71xx.c b/drivers/net/ag71xx.c index 70aaa60f1a..cf00c2eb09 100644 --- a/drivers/net/ag71xx.c +++ b/drivers/net/ag71xx.c @@ -211,7 +211,7 @@ typedef struct { #define MAX_WAIT 1000 struct ag71xx { - struct device_d *dev; + struct device *dev; struct eth_device netdev; void __iomem *regs; void __iomem *regs_gmac; @@ -287,7 +287,7 @@ static inline void ag71xx_wr(struct ag71xx *priv, int reg, u32 val) static int ag71xx_mii_wait(struct ag71xx *priv, int write) { - struct device_d *dev = priv->dev; + struct device *dev = priv->dev; uint64_t start; start = get_time_ns(); @@ -371,7 +371,7 @@ static int ag71xx_ether_get_ethaddr(struct eth_device *edev, unsigned char *adr) static void ag71xx_ether_halt(struct eth_device *edev) { struct ag71xx *priv = edev->priv; - struct device_d *dev = priv->dev; + struct device *dev = priv->dev; uint64_t start; ag71xx_wr(priv, AG71XX_REG_RX_CTRL, 0); @@ -403,7 +403,7 @@ static int ag71xx_ether_rx(struct eth_device *edev) rx_pkt = priv->rx_pkt[priv->next_rx]; /* invalidate */ - dma_sync_single_for_cpu((unsigned long)rx_pkt, pktlen, + dma_sync_single_for_cpu(priv->dev, (unsigned long)rx_pkt, pktlen, DMA_FROM_DEVICE); net_receive(edev, rx_pkt, pktlen - 4); @@ -425,13 +425,13 @@ static int ag71xx_ether_rx(struct eth_device *edev) static int ag71xx_ether_send(struct eth_device *edev, void *packet, int length) { struct ag71xx *priv = edev->priv; - struct device_d *dev = priv->dev; + struct device *dev = priv->dev; ag7240_desc_t *f = &priv->fifo_tx[priv->next_tx]; uint64_t start; int ret = 0; /* flush */ - dma_sync_single_for_device((unsigned long)packet, length, DMA_TO_DEVICE); + dma_sync_single_for_device(dev, (unsigned long)packet, length, DMA_TO_DEVICE); f->pkt_start_addr = virt_to_phys(packet); f->res1 = 0; @@ -441,7 +441,7 @@ static int ag71xx_ether_send(struct eth_device *edev, void *packet, int length) ag71xx_wr(priv, AG71XX_REG_TX_CTRL, TX_CTRL_TXE); /* flush again?! */ - dma_sync_single_for_cpu((unsigned long)packet, length, DMA_TO_DEVICE); + dma_sync_single_for_cpu(dev, (unsigned long)packet, length, DMA_TO_DEVICE); start = get_time_ns(); while (!f->is_empty) { @@ -491,7 +491,7 @@ static int ag71xx_ether_init(struct eth_device *edev) fr->next_desc = virt_to_phys(&priv->fifo_rx[(i + 1) % NO_OF_RX_FIFOS]); /* invalidate */ - dma_sync_single_for_device((unsigned long)rxbuf, MAX_RBUFF_SZ, + dma_sync_single_for_device(priv->dev, (unsigned long)rxbuf, MAX_RBUFF_SZ, DMA_FROM_DEVICE); rxbuf += MAX_RBUFF_SZ; @@ -549,7 +549,7 @@ static struct ag71xx_cfg ag71xx_cfg_ar9344_gmac0 = { .init_mii = ag71xx_ar9344_gmac0_mii_init, }; -static int ag71xx_probe(struct device_d *dev) +static int ag71xx_probe(struct device *dev) { void __iomem *regs, *regs_gmac; struct mii_bus *miibus; @@ -659,7 +659,7 @@ static int ag71xx_probe(struct device_d *dev) return 0; } -static void ag71xx_remove(struct device_d *dev) +static void ag71xx_remove(struct device *dev) { struct eth_device *edev = dev->priv; @@ -671,8 +671,9 @@ static __maybe_unused struct of_device_id ag71xx_dt_ids[] = { { .compatible = "qca,ar9344-gmac0", .data = &ag71xx_cfg_ar9344_gmac0, }, { /* sentinel */ } }; +MODULE_DEVICE_TABLE(of, ag71xx_dt_ids); -static struct driver_d ag71xx_driver = { +static struct driver ag71xx_driver = { .name = "ag71xx-gmac", .probe = ag71xx_probe, .remove = ag71xx_remove, |