Commit f96f7004 authored by Marek Vasut's avatar Marek Vasut Committed by Jakub Kicinski

net: ks8851: Inline ks8851_rx_skb()

Both ks8851_rx_skb_par() and ks8851_rx_skb_spi() call netif_rx(skb),
inline the netif_rx(skb) call directly into ks8851_common.c and drop
the .rx_skb callback and ks8851_rx_skb() wrapper. This removes one
indirect call from the driver, no functional change otherwise.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20240405203204.82062-1-marex@denx.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 7e68708b
...@@ -368,7 +368,6 @@ union ks8851_tx_hdr { ...@@ -368,7 +368,6 @@ union ks8851_tx_hdr {
* @rdfifo: FIFO read callback * @rdfifo: FIFO read callback
* @wrfifo: FIFO write callback * @wrfifo: FIFO write callback
* @start_xmit: start_xmit() implementation callback * @start_xmit: start_xmit() implementation callback
* @rx_skb: rx_skb() implementation callback
* @flush_tx_work: flush_tx_work() implementation callback * @flush_tx_work: flush_tx_work() implementation callback
* *
* The @statelock is used to protect information in the structure which may * The @statelock is used to protect information in the structure which may
...@@ -423,8 +422,6 @@ struct ks8851_net { ...@@ -423,8 +422,6 @@ struct ks8851_net {
struct sk_buff *txp, bool irq); struct sk_buff *txp, bool irq);
netdev_tx_t (*start_xmit)(struct sk_buff *skb, netdev_tx_t (*start_xmit)(struct sk_buff *skb,
struct net_device *dev); struct net_device *dev);
void (*rx_skb)(struct ks8851_net *ks,
struct sk_buff *skb);
void (*flush_tx_work)(struct ks8851_net *ks); void (*flush_tx_work)(struct ks8851_net *ks);
}; };
......
...@@ -231,16 +231,6 @@ static void ks8851_dbg_dumpkkt(struct ks8851_net *ks, u8 *rxpkt) ...@@ -231,16 +231,6 @@ static void ks8851_dbg_dumpkkt(struct ks8851_net *ks, u8 *rxpkt)
rxpkt[12], rxpkt[13], rxpkt[14], rxpkt[15]); rxpkt[12], rxpkt[13], rxpkt[14], rxpkt[15]);
} }
/**
* ks8851_rx_skb - receive skbuff
* @ks: The device state.
* @skb: The skbuff
*/
static void ks8851_rx_skb(struct ks8851_net *ks, struct sk_buff *skb)
{
ks->rx_skb(ks, skb);
}
/** /**
* ks8851_rx_pkts - receive packets from the host * ks8851_rx_pkts - receive packets from the host
* @ks: The device information. * @ks: The device information.
...@@ -309,7 +299,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) ...@@ -309,7 +299,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
ks8851_dbg_dumpkkt(ks, rxpkt); ks8851_dbg_dumpkkt(ks, rxpkt);
skb->protocol = eth_type_trans(skb, ks->netdev); skb->protocol = eth_type_trans(skb, ks->netdev);
ks8851_rx_skb(ks, skb); netif_rx(skb);
ks->netdev->stats.rx_packets++; ks->netdev->stats.rx_packets++;
ks->netdev->stats.rx_bytes += rxlen; ks->netdev->stats.rx_bytes += rxlen;
......
...@@ -210,16 +210,6 @@ static void ks8851_wrfifo_par(struct ks8851_net *ks, struct sk_buff *txp, ...@@ -210,16 +210,6 @@ static void ks8851_wrfifo_par(struct ks8851_net *ks, struct sk_buff *txp,
iowrite16_rep(ksp->hw_addr, txp->data, len / 2); iowrite16_rep(ksp->hw_addr, txp->data, len / 2);
} }
/**
* ks8851_rx_skb_par - receive skbuff
* @ks: The device state.
* @skb: The skbuff
*/
static void ks8851_rx_skb_par(struct ks8851_net *ks, struct sk_buff *skb)
{
netif_rx(skb);
}
static unsigned int ks8851_rdreg16_par_txqcr(struct ks8851_net *ks) static unsigned int ks8851_rdreg16_par_txqcr(struct ks8851_net *ks)
{ {
return ks8851_rdreg16_par(ks, KS_TXQCR); return ks8851_rdreg16_par(ks, KS_TXQCR);
...@@ -298,7 +288,6 @@ static int ks8851_probe_par(struct platform_device *pdev) ...@@ -298,7 +288,6 @@ static int ks8851_probe_par(struct platform_device *pdev)
ks->rdfifo = ks8851_rdfifo_par; ks->rdfifo = ks8851_rdfifo_par;
ks->wrfifo = ks8851_wrfifo_par; ks->wrfifo = ks8851_wrfifo_par;
ks->start_xmit = ks8851_start_xmit_par; ks->start_xmit = ks8851_start_xmit_par;
ks->rx_skb = ks8851_rx_skb_par;
#define STD_IRQ (IRQ_LCI | /* Link Change */ \ #define STD_IRQ (IRQ_LCI | /* Link Change */ \
IRQ_RXI | /* RX done */ \ IRQ_RXI | /* RX done */ \
......
...@@ -298,16 +298,6 @@ static unsigned int calc_txlen(unsigned int len) ...@@ -298,16 +298,6 @@ static unsigned int calc_txlen(unsigned int len)
return ALIGN(len + 4, 4); return ALIGN(len + 4, 4);
} }
/**
* ks8851_rx_skb_spi - receive skbuff
* @ks: The device state
* @skb: The skbuff
*/
static void ks8851_rx_skb_spi(struct ks8851_net *ks, struct sk_buff *skb)
{
netif_rx(skb);
}
/** /**
* ks8851_tx_work - process tx packet(s) * ks8851_tx_work - process tx packet(s)
* @work: The work strucutre what was scheduled. * @work: The work strucutre what was scheduled.
...@@ -435,7 +425,6 @@ static int ks8851_probe_spi(struct spi_device *spi) ...@@ -435,7 +425,6 @@ static int ks8851_probe_spi(struct spi_device *spi)
ks->rdfifo = ks8851_rdfifo_spi; ks->rdfifo = ks8851_rdfifo_spi;
ks->wrfifo = ks8851_wrfifo_spi; ks->wrfifo = ks8851_wrfifo_spi;
ks->start_xmit = ks8851_start_xmit_spi; ks->start_xmit = ks8851_start_xmit_spi;
ks->rx_skb = ks8851_rx_skb_spi;
ks->flush_tx_work = ks8851_flush_tx_work_spi; ks->flush_tx_work = ks8851_flush_tx_work_spi;
#define STD_IRQ (IRQ_LCI | /* Link Change */ \ #define STD_IRQ (IRQ_LCI | /* Link Change */ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment