Netdev List
 help / color / mirror / Atom feed
* [PATCH] can: m_can: remove redundant check for pm_clock_support
@ 2024-01-04 23:57 Francesco Dolcini
  2024-01-15  9:52 ` Markus Schneider-Pargmann
  2024-02-16  7:45 ` Francesco Dolcini
  0 siblings, 2 replies; 4+ messages in thread
From: Francesco Dolcini @ 2024-01-04 23:57 UTC (permalink / raw)
  To: Chandrasekar Ramakrishnan, Wolfgang Grandegger, Marc Kleine-Budde,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Francesco Dolcini, linux-can, netdev, linux-kernel

From: Francesco Dolcini <francesco.dolcini@toradex.com>

m_can_clk_start() already skip starting the clock when
clock support is disabled, remove the redundant check in
m_can_class_register().

This also solves the imbalance with m_can_clk_stop() that is called
afterward in the same function before the return.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
I spotted the issue while debugging some other part of the code,
the patch is only compile-tested.
---
 drivers/net/can/m_can/m_can.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 16ecc11c7f62..bd1d1626684d 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -2056,11 +2056,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
 {
 	int ret;
 
-	if (cdev->pm_clock_support) {
-		ret = m_can_clk_start(cdev);
-		if (ret)
-			return ret;
-	}
+	ret = m_can_clk_start(cdev);
+	if (ret)
+		return ret;
 
 	if (cdev->is_peripheral) {
 		ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
-- 
2.39.2


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

end of thread, other threads:[~2024-02-16  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 23:57 [PATCH] can: m_can: remove redundant check for pm_clock_support Francesco Dolcini
2024-01-15  9:52 ` Markus Schneider-Pargmann
2024-02-16  7:45 ` Francesco Dolcini
2024-02-16  7:56   ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox