[PATCHv9 1/3] net: velocity: Rename vptr->dev to vptr->netdev
Improve the clarity of the code in preparation for converting the dma functions to generic versions, which require a struct device *. This makes it possible to store a 'struct device *dev' in the velocity_info structure. Signed-off-by: Tony Prisk --- drivers/net/ethernet/via/via-velocity.c | 66 +++ drivers/net/ethernet/via/via-velocity.h |4 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index fb62489..187eef3 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c @@ -998,9 +998,9 @@ static void velocity_print_link_status(struct velocity_info *vptr) { if (vptr->mii_status & VELOCITY_LINK_FAIL) { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: failed to detect cable link\n", vptr->dev->name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: failed to detect cable link\n", vptr->netdev->name); } else if (vptr->options.spd_dpx == SPD_DPX_AUTO) { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link auto-negotiation", vptr->dev->name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link auto-negotiation", vptr->netdev->name); if (vptr->mii_status & VELOCITY_SPEED_1000) VELOCITY_PRT(MSG_LEVEL_INFO, " speed 1000M bps"); @@ -1014,7 +1014,7 @@ static void velocity_print_link_status(struct velocity_info *vptr) else VELOCITY_PRT(MSG_LEVEL_INFO, " half duplex\n"); } else { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link forced", vptr->dev->name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE "%s: Link forced", vptr->netdev->name); switch (vptr->options.spd_dpx) { case SPD_DPX_1000_FULL: VELOCITY_PRT(MSG_LEVEL_INFO, " speed 1000M bps full duplex\n"); @@ -1319,7 +1319,7 @@ static void velocity_init_registers(struct velocity_info *vptr, case VELOCITY_INIT_RESET: case VELOCITY_INIT_WOL: - netif_stop_queue(vptr->dev); + netif_stop_queue(vptr->netdev); /* * Reset RX to prevent RX pointer not on the 4X location @@ -1332,7 +1332,7 @@ static void velocity_init_registers(struct velocity_info *vptr, if (velocity_set_media_mode(vptr, mii_status) != VELOCITY_LINK_CHANGE) { velocity_print_link_status(vptr); if (!(vptr->mii_status & VELOCITY_LINK_FAIL)) - netif_wake_queue(vptr->dev); + netif_wake_queue(vptr->netdev); } enable_flow_control_ability(vptr); @@ -1354,7 +1354,7 @@ static void velocity_init_registers(struct velocity_info *vptr, mac_eeprom_reload(regs); for (i = 0; i < 6; i++) - writeb(vptr->dev->dev_addr[i], &(regs->PAR[i])); + writeb(vptr->netdev->dev_addr[i], &(regs->PAR[i])); /* * clear Pre_ACPI bit. @@ -1377,7 +1377,7 @@ static void velocity_init_registers(struct velocity_info *vptr, /* * Set packet filter: Receive directed and broadcast address */ - velocity_set_multi(vptr->dev); + velocity_set_multi(vptr->netdev); /* * Enable MII auto-polling @@ -1404,14 +1404,14 @@ static void velocity_init_registers(struct velocity_info *vptr, writel((CR0_DPOLL | CR0_TXON | CR0_RXON | CR0_STRT), >CR0Set); mii_status = velocity_get_opt_media_mode(vptr); - netif_stop_queue(vptr->dev); + netif_stop_queue(vptr->netdev); mii_init(vptr, mii_status); if (velocity_set_media_mode(vptr, mii_status) != VELOCITY_LINK_CHANGE) { velocity_print_link_status(vptr); if (!(vptr->mii_status & VELOCITY_LINK_FAIL)) - netif_wake_queue(vptr->dev); + netif_wake_queue(vptr->netdev); } enable_flow_control_ability(vptr); @@ -1474,7 +1474,7 @@ static int velocity_init_dma_rings(struct velocity_info *vptr) rx_ring_size, _dma); if (!pool) { dev_err(>dev, "%s : DMA memory allocation failed.\n", - vptr->dev->name); + vptr->netdev->name); return -ENOMEM; } @@ -1514,7 +1514,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) struct rx_desc *rd = &(vptr->rx.ring[idx]); struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]); -
[PATCHv9 1/3] net: velocity: Rename vptr-dev to vptr-netdev
Improve the clarity of the code in preparation for converting the dma functions to generic versions, which require a struct device *. This makes it possible to store a 'struct device *dev' in the velocity_info structure. Signed-off-by: Tony Prisk li...@prisktech.co.nz --- drivers/net/ethernet/via/via-velocity.c | 66 +++ drivers/net/ethernet/via/via-velocity.h |4 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index fb62489..187eef3 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c @@ -998,9 +998,9 @@ static void velocity_print_link_status(struct velocity_info *vptr) { if (vptr-mii_status VELOCITY_LINK_FAIL) { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: failed to detect cable link\n, vptr-dev-name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: failed to detect cable link\n, vptr-netdev-name); } else if (vptr-options.spd_dpx == SPD_DPX_AUTO) { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: Link auto-negotiation, vptr-dev-name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: Link auto-negotiation, vptr-netdev-name); if (vptr-mii_status VELOCITY_SPEED_1000) VELOCITY_PRT(MSG_LEVEL_INFO, speed 1000M bps); @@ -1014,7 +1014,7 @@ static void velocity_print_link_status(struct velocity_info *vptr) else VELOCITY_PRT(MSG_LEVEL_INFO, half duplex\n); } else { - VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: Link forced, vptr-dev-name); + VELOCITY_PRT(MSG_LEVEL_INFO, KERN_NOTICE %s: Link forced, vptr-netdev-name); switch (vptr-options.spd_dpx) { case SPD_DPX_1000_FULL: VELOCITY_PRT(MSG_LEVEL_INFO, speed 1000M bps full duplex\n); @@ -1319,7 +1319,7 @@ static void velocity_init_registers(struct velocity_info *vptr, case VELOCITY_INIT_RESET: case VELOCITY_INIT_WOL: - netif_stop_queue(vptr-dev); + netif_stop_queue(vptr-netdev); /* * Reset RX to prevent RX pointer not on the 4X location @@ -1332,7 +1332,7 @@ static void velocity_init_registers(struct velocity_info *vptr, if (velocity_set_media_mode(vptr, mii_status) != VELOCITY_LINK_CHANGE) { velocity_print_link_status(vptr); if (!(vptr-mii_status VELOCITY_LINK_FAIL)) - netif_wake_queue(vptr-dev); + netif_wake_queue(vptr-netdev); } enable_flow_control_ability(vptr); @@ -1354,7 +1354,7 @@ static void velocity_init_registers(struct velocity_info *vptr, mac_eeprom_reload(regs); for (i = 0; i 6; i++) - writeb(vptr-dev-dev_addr[i], (regs-PAR[i])); + writeb(vptr-netdev-dev_addr[i], (regs-PAR[i])); /* * clear Pre_ACPI bit. @@ -1377,7 +1377,7 @@ static void velocity_init_registers(struct velocity_info *vptr, /* * Set packet filter: Receive directed and broadcast address */ - velocity_set_multi(vptr-dev); + velocity_set_multi(vptr-netdev); /* * Enable MII auto-polling @@ -1404,14 +1404,14 @@ static void velocity_init_registers(struct velocity_info *vptr, writel((CR0_DPOLL | CR0_TXON | CR0_RXON | CR0_STRT), regs-CR0Set); mii_status = velocity_get_opt_media_mode(vptr); - netif_stop_queue(vptr-dev); + netif_stop_queue(vptr-netdev); mii_init(vptr, mii_status); if (velocity_set_media_mode(vptr, mii_status) != VELOCITY_LINK_CHANGE) { velocity_print_link_status(vptr); if (!(vptr-mii_status VELOCITY_LINK_FAIL)) - netif_wake_queue(vptr-dev); + netif_wake_queue(vptr-netdev); } enable_flow_control_ability(vptr); @@ -1474,7 +1474,7 @@ static int velocity_init_dma_rings(struct velocity_info *vptr) rx_ring_size, pool_dma); if (!pool) { dev_err(pdev-dev, %s : DMA memory allocation failed.\n, - vptr-dev-name); + vptr-netdev-name); return -ENOMEM; } @@ -1514,7 +1514,7 @@ static int velocity_alloc_rx_buf(struct velocity_info *vptr, int idx) struct rx_desc *rd = (vptr-rx.ring[idx]); struct velocity_rd_info *rd_info = (vptr-rx.info[idx]); - rd_info-skb = netdev_alloc_skb(vptr-dev,