]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: ks8851: Permit overridding interrupt enable register
authorMarek Vasut <marex@denx.de>
Thu, 28 May 2020 22:21:42 +0000 (00:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 May 2020 23:30:04 +0000 (16:30 -0700)
The parallel bus variant does not need to use the TX interrupt at all
as it writes the TX FIFO directly with in .ndo_start_xmit, permit the
drivers to configure the interrupt enable bits.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Petr Stetiar <ynezz@true.cz>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/micrel/ks8851.c

index 458c86903ac09fabd0459172c8152919de2caa07..baf424f9893b1a05ff7e688f302cb17f7e44e6a8 100644 (file)
@@ -859,17 +859,8 @@ static int ks8851_net_open(struct net_device *dev)
        ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr);
 
        /* clear then enable interrupts */
-
-#define STD_IRQ (IRQ_LCI |     /* Link Change */       \
-                IRQ_TXI |      /* TX done */           \
-                IRQ_RXI |      /* RX done */           \
-                IRQ_SPIBEI |   /* SPI bus error */     \
-                IRQ_TXPSI |    /* TX process stop */   \
-                IRQ_RXPSI)     /* RX process stop */
-
-       ks->rc_ier = STD_IRQ;
-       ks8851_wrreg16(ks, KS_ISR, STD_IRQ);
-       ks8851_wrreg16(ks, KS_IER, STD_IRQ);
+       ks8851_wrreg16(ks, KS_ISR, ks->rc_ier);
+       ks8851_wrreg16(ks, KS_IER, ks->rc_ier);
 
        netif_start_queue(ks->netdev);
 
@@ -1599,6 +1590,15 @@ static int ks8851_probe(struct spi_device *spi)
        spi->bits_per_word = 8;
 
        ks = netdev_priv(netdev);
+
+#define STD_IRQ (IRQ_LCI |     /* Link Change */       \
+                IRQ_TXI |      /* TX done */           \
+                IRQ_RXI |      /* RX done */           \
+                IRQ_SPIBEI |   /* SPI bus error */     \
+                IRQ_TXPSI |    /* TX process stop */   \
+                IRQ_RXPSI)     /* RX process stop */
+       ks->rc_ier = STD_IRQ;
+
        kss = to_ks8851_spi(ks);
 
        kss->spidev = spi;