netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH can-next] can: mcan: m_can_open(): simplify condition to call free_irq()
@ 2024-09-30 18:03 Marc Kleine-Budde
  2024-10-01 11:12 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2024-09-30 18:03 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Vincent Mailhol, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, kernel, linux-can, netdev, linux-kernel,
	Marc Kleine-Budde

The condition to call free_irq() in the error cleanup path of
m_can_open() can be simplified. The "is_peripheral" case also has a
"dev->irq != 0".

Simplify the condition, call free_irq() if "dev->irq != 0", i.e. the
device has an interrupt.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/m_can.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index a978b960f1f1e1e8273216ff330ab789d0fd6d51..66a8673e51eab8c901434de16c640045f7d0dd70 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2070,7 +2070,7 @@ static int m_can_open(struct net_device *dev)
 	return 0;
 
 exit_start_fail:
-	if (cdev->is_peripheral || dev->irq)
+	if (dev->irq)
 		free_irq(dev->irq, dev);
 exit_irq_fail:
 	if (cdev->is_peripheral)

---
base-commit: c824deb1a89755f70156b5cdaf569fca80698719
change-id: 20240930-m_can-simplify-f50760775f3b

Best regards,
-- 
Marc Kleine-Budde <mkl@pengutronix.de>



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH can-next] can: mcan: m_can_open(): simplify condition to call free_irq()
  2024-09-30 18:03 [PATCH can-next] can: mcan: m_can_open(): simplify condition to call free_irq() Marc Kleine-Budde
@ 2024-10-01 11:12 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2024-10-01 11:12 UTC (permalink / raw)
  To: Marc Kleine-Budde
  Cc: Chandrasekar Ramakrishnan, Vincent Mailhol, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, kernel, linux-can,
	netdev, linux-kernel

On Mon, Sep 30, 2024 at 08:03:46PM +0200, Marc Kleine-Budde wrote:
> The condition to call free_irq() in the error cleanup path of
> m_can_open() can be simplified. The "is_peripheral" case also has a
> "dev->irq != 0".
> 
> Simplify the condition, call free_irq() if "dev->irq != 0", i.e. the
> device has an interrupt.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-10-01 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-30 18:03 [PATCH can-next] can: mcan: m_can_open(): simplify condition to call free_irq() Marc Kleine-Budde
2024-10-01 11:12 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).