mirror of
https://github.com/torvalds/linux.git
synced 2026-05-22 14:12:07 +02:00
can: m_can: m_can_close(): don't call free_irq() for IRQ-less devices
In commitb382380c0d("can: m_can: Add hrtimer to generate software interrupt") support for IRQ-less devices was added. Instead of an interrupt, the interrupt routine is called by a hrtimer-based polling loop. That patch forgot to change free_irq() to be only called for devices with IRQs. Fix this, by calling free_irq() conditionally only if an IRQ is available for the device (and thus has been requested previously). Fixes:b382380c0d("can: m_can: Add hrtimer to generate software interrupt") Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com> Link: https://patch.msgid.link/20240930-m_can-cleanups-v1-1-001c579cdee4@pengutronix.de Cc: <stable@vger.kernel.org> # v6.6+ Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
7b22846f8a
commit
e4de81f9e1
|
|
@ -1765,7 +1765,8 @@ static int m_can_close(struct net_device *dev)
|
|||
netif_stop_queue(dev);
|
||||
|
||||
m_can_stop(dev);
|
||||
free_irq(dev->irq, dev);
|
||||
if (dev->irq)
|
||||
free_irq(dev->irq, dev);
|
||||
|
||||
m_can_clean(dev);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user