[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240930-m_can-simplify-v1-1-43312571c028@pengutronix.de>
Date: Mon, 30 Sep 2024 20:03:46 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
Vincent Mailhol <mailhol.vincent@...adoo.fr>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>
Cc: Simon Horman <horms@...nel.org>, kernel@...gutronix.de,
linux-can@...r.kernel.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH can-next] can: mcan: m_can_open(): simplify condition to
call free_irq()
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@...gutronix.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@...gutronix.de>
Powered by blists - more mailing lists