Commit 40e4552e authored by Markus Schneider-Pargmann's avatar Markus Schneider-Pargmann Committed by Marc Kleine-Budde
Browse files

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: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240805183047.305630-4-msp@baylibre.com


Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent 6eff1cea
Loading
Loading
Loading
Loading
+1 −17
Original line number Diff line number Diff line
@@ -1037,22 +1037,6 @@ static int m_can_rx_handler(struct net_device *dev, int quota, u32 irqstatus)
	return work_done;
}

static int m_can_rx_peripheral(struct net_device *dev, u32 irqstatus)
{
	struct m_can_classdev *cdev = netdev_priv(dev);
	int work_done;

	work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT, irqstatus);

	/* Don't re-enable interrupts if the driver had a fatal error
	 * (e.g., FIFO read failure).
	 */
	if (work_done < 0)
		m_can_disable_all_interrupts(cdev);

	return work_done;
}

static int m_can_poll(struct napi_struct *napi, int quota)
{
	struct net_device *dev = napi->dev;
@@ -1250,7 +1234,7 @@ static irqreturn_t m_can_isr(int irq, void *dev_id)
		} else {
			int pkts;

			pkts = m_can_rx_peripheral(dev, ir);
			pkts = m_can_rx_handler(dev, NAPI_POLL_WEIGHT, ir);
			if (pkts < 0)
				goto out_fail;
		}