]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: fman: Change return type of disable to void
authorSean Anderson <sean.anderson@seco.com>
Fri, 2 Sep 2022 21:57:32 +0000 (17:57 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 5 Sep 2022 13:27:39 +0000 (14:27 +0100)
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>
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
drivers/net/ethernet/freescale/fman/fman_dtsec.c
drivers/net/ethernet/freescale/fman/fman_memac.c
drivers/net/ethernet/freescale/fman/fman_tgec.c
drivers/net/ethernet/freescale/fman/mac.h

index 02b588c46fcff34877dafe024f8f283b43200a2f..d378247a6d0c9cd21b019e17504579a650dd7128 100644 (file)
@@ -290,10 +290,7 @@ static int dpaa_stop(struct net_device *net_dev)
 
        if (mac_dev->phy_dev)
                phy_stop(mac_dev->phy_dev);
-       err = mac_dev->disable(mac_dev->fman_mac);
-       if (err < 0)
-               netif_err(priv, ifdown, net_dev, "mac_dev->disable() = %d\n",
-                         err);
+       mac_dev->disable(mac_dev->fman_mac);
 
        for (i = 0; i < ARRAY_SIZE(mac_dev->port); i++) {
                error = fman_port_disable(mac_dev->port[i]);
index 7acd5742403447b2adba123444ab8898c9718db5..f2dd07b714eace708a03955b22bf40fbcb7ef4eb 100644 (file)
@@ -871,13 +871,12 @@ static int dtsec_enable(struct fman_mac *dtsec)
        return 0;
 }
 
-static int dtsec_disable(struct fman_mac *dtsec)
+static void dtsec_disable(struct fman_mac *dtsec)
 {
        struct dtsec_regs __iomem *regs = dtsec->regs;
        u32 tmp;
 
-       if (!is_init_done(dtsec->dtsec_drv_param))
-               return -EINVAL;
+       WARN_ON_ONCE(!is_init_done(dtsec->dtsec_drv_param));
 
        /* Graceful stop - Assert the graceful Rx/Tx stop bit */
        graceful_stop(dtsec);
@@ -885,8 +884,6 @@ static int dtsec_disable(struct fman_mac *dtsec)
        tmp = ioread32be(&regs->maccfg1);
        tmp &= ~(MACCFG1_RX_EN | MACCFG1_TX_EN);
        iowrite32be(tmp, &regs->maccfg1);
-
-       return 0;
 }
 
 static int dtsec_set_tx_pause_frames(struct fman_mac *dtsec,
index 0e0d9415b93eebc7c748ea69a453136aad05c5ae..fc79abd1f204fe0d58cce62db0a292e45f89f9cf 100644 (file)
@@ -701,19 +701,17 @@ static int memac_enable(struct fman_mac *memac)
        return 0;
 }
 
-static int memac_disable(struct fman_mac *memac)
+static void memac_disable(struct fman_mac *memac)
+
 {
        struct memac_regs __iomem *regs = memac->regs;
        u32 tmp;
 
-       if (!is_init_done(memac->memac_drv_param))
-               return -EINVAL;
+       WARN_ON_ONCE(!is_init_done(memac->memac_drv_param));
 
        tmp = ioread32be(&regs->command_config);
        tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN);
        iowrite32be(tmp, &regs->command_config);
-
-       return 0;
 }
 
 static int memac_set_promiscuous(struct fman_mac *memac, bool new_val)
index 0a66ae58c026ae8dfc852e35d64351132c29c69c..1b60239d5fc76a041b85fe57f60251a0bbc278be 100644 (file)
@@ -408,19 +408,16 @@ static int tgec_enable(struct fman_mac *tgec)
        return 0;
 }
 
-static int tgec_disable(struct fman_mac *tgec)
+static void tgec_disable(struct fman_mac *tgec)
 {
        struct tgec_regs __iomem *regs = tgec->regs;
        u32 tmp;
 
-       if (!is_init_done(tgec->cfg))
-               return -EINVAL;
+       WARN_ON_ONCE(!is_init_done(tgec->cfg));
 
        tmp = ioread32be(&regs->command_config);
        tmp &= ~(CMD_CFG_RX_EN | CMD_CFG_TX_EN);
        iowrite32be(tmp, &regs->command_config);
-
-       return 0;
 }
 
 static int tgec_set_promiscuous(struct fman_mac *tgec, bool new_val)
index c5fb4d46210fcc70e4a1ff055b7194903c047dc6..a55efcb7998c0cc0dff6c094374bb459f8eda384 100644 (file)
@@ -38,7 +38,7 @@ struct mac_device {
        bool allmulti;
 
        int (*enable)(struct fman_mac *mac_dev);
-       int (*disable)(struct fman_mac *mac_dev);
+       void (*disable)(struct fman_mac *mac_dev);
        void (*adjust_link)(struct mac_device *mac_dev);
        int (*set_promisc)(struct fman_mac *mac_dev, bool enable);
        int (*change_addr)(struct fman_mac *mac_dev, const enet_addr_t *enet_addr);