Commit e517293f authored by Francesco Dolcini's avatar Francesco Dolcini Committed by Marc Kleine-Budde

can: m_can: remove redundant check for pm_clock_support

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: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: default avatarMarkus Schneider-Pargmann <msp@baylibre.com>
Link: https://lore.kernel.org/all/20240104235723.46931-1-francesco@dolcini.it
[mkl: rebased to net-next/main]
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent e1a00373
......@@ -2312,11 +2312,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
}
}
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment