Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: fman: Change return type of disable to void

When disabling, there is nothing we can do about errors. In fact, the
only error which can occur is misuse of the API. Just warn in the mac
driver instead.

Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Acked-by: Camelia Groza <camelia.groza@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sean Anderson and committed by
David S. Miller
901bdff2 aedbeb4e

+9 -20
+1 -4
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
··· 290 290 291 291 if (mac_dev->phy_dev) 292 292 phy_stop(mac_dev->phy_dev); 293 - err = mac_dev->disable(mac_dev->fman_mac); 294 - if (err < 0) 295 - netif_err(priv, ifdown, net_dev, "mac_dev->disable() = %d\n", 296 - err); 293 + mac_dev->disable(mac_dev->fman_mac); 297 294 298 295 for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) { 299 296 error = fman_port_disable(mac_dev->port[i]);
+2 -5
drivers/net/ethernet/freescale/fman/fman_dtsec.c
··· 871 871 return 0; 872 872 } 873 873 874 - static int dtsec_disable(struct fman_mac *dtsec) 874 + static void dtsec_disable(struct fman_mac *dtsec) 875 875 { 876 876 struct dtsec_regs __iomem *regs = dtsec->regs; 877 877 u32 tmp; 878 878 879 - if (!is_init_done(dtsec->dtsec_drv_param)) 880 - return -EINVAL; 879 + WARN_ON_ONCE(!is_init_done(dtsec->dtsec_drv_param)); 881 880 882 881 /* Graceful stop - Assert the graceful Rx/Tx stop bit */ 883 882 graceful_stop(dtsec); ··· 884 885 tmp = ioread32be(&regs->maccfg1); 885 886 tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN); 886 887 iowrite32be(tmp, &regs->maccfg1); 887 - 888 - return 0; 889 888 } 890 889 891 890 static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,
+3 -5
drivers/net/ethernet/freescale/fman/fman_memac.c
··· 701 701 return 0; 702 702 } 703 703 704 - static int memac_disable(struct fman_mac *memac) 704 + static void memac_disable(struct fman_mac *memac) 705 + 705 706 { 706 707 struct memac_regs __iomem *regs = memac->regs; 707 708 u32 tmp; 708 709 709 - if (!is_init_done(memac->memac_drv_param)) 710 - return -EINVAL; 710 + WARN_ON_ONCE(!is_init_done(memac->memac_drv_param)); 711 711 712 712 tmp = ioread32be(&regs->command_config); 713 713 tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); 714 714 iowrite32be(tmp, &regs->command_config); 715 - 716 - return 0; 717 715 } 718 716 719 717 static int memac_set_promiscuous(struct fman_mac *memac, bool new_val)
+2 -5
drivers/net/ethernet/freescale/fman/fman_tgec.c
··· 408 408 return 0; 409 409 } 410 410 411 - static int tgec_disable(struct fman_mac *tgec) 411 + static void tgec_disable(struct fman_mac *tgec) 412 412 { 413 413 struct tgec_regs __iomem *regs = tgec->regs; 414 414 u32 tmp; 415 415 416 - if (!is_init_done(tgec->cfg)) 417 - return -EINVAL; 416 + WARN_ON_ONCE(!is_init_done(tgec->cfg)); 418 417 419 418 tmp = ioread32be(&regs->command_config); 420 419 tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN); 421 420 iowrite32be(tmp, &regs->command_config); 422 - 423 - return 0; 424 421 } 425 422 426 423 static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val)
+1 -1
drivers/net/ethernet/freescale/fman/mac.h
··· 38 38 bool allmulti; 39 39 40 40 int (*enable)(struct fman_mac *mac_dev); 41 - int (*disable)(struct fman_mac *mac_dev); 41 + void (*disable)(struct fman_mac *mac_dev); 42 42 void (*adjust_link)(struct mac_device *mac_dev); 43 43 int (*set_promisc)(struct fman_mac *mac_dev, bool enable); 44 44 int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr);