Skip to content

Commit 40e4552

Browse files
scosumarckleinebudde
authored andcommitted
can: m_can: Remove m_can_rx_peripheral indirection
m_can_rx_peripheral() is a wrapper around m_can_rx_handler() that calls m_can_disable_all_interrupts() on error. The same handling for the same error path is done in m_can_isr() as well. So remove m_can_rx_peripheral() and do the call from m_can_isr() directly. Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com> Link: https://lore.kernel.org/all/20240805183047.305630-4-msp@baylibre.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
1 parent 6eff1ce commit 40e4552

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

drivers/net/can/m_can/m_can.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,22 +1037,6 @@ static int m_can_rx_handler(struct net_device *dev, int quota, u32 irqstatus)
10371037
return work_done;
10381038
}
10391039

1040-
static int m_can_rx_peripheral(struct net_device *dev, u32 irqstatus)
1041-
{
1042-
struct m_can_classdev *cdev = netdev_priv(dev);
1043-
int work_done;
1044-
1045-
work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT, irqstatus);
1046-
1047-
/* Don't re-enable interrupts if the driver had a fatal error
1048-
* (e.g., FIFO read failure).
1049-
*/
1050-
if (work_done < 0)
1051-
m_can_disable_all_interrupts(cdev);
1052-
1053-
return work_done;
1054-
}
1055-
10561040
static int m_can_poll(struct napi_struct *napi, int quota)
10571041
{
10581042
struct net_device *dev = napi->dev;
@@ -1250,7 +1234,7 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
12501234
} else {
12511235
int pkts;
12521236

1253-
pkts = m_can_rx_peripheral(dev, ir);
1237+
pkts = m_can_rx_handler(dev, NAPI_POLL_WEIGHT, ir);
12541238
if (pkts < 0)
12551239
goto out_fail;
12561240
}

0 commit comments

Comments
 (0)