mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-12 07:05:09 -04:00
can: mcp251xfd: mcp251xfd_unregister(): simplify runtime PM handling
The mcp251xfd driver supports runtime PM enabled kernels, but also works on !CONFIG_PM configurations. This patch simplifies the runtime PM handling in the mcp251xfd_unregister(). In the CONFIG_PM case, runtime PM has been enabled in the mcp251xfd_probe() function, so we can disable it here. For !CONFIG_PM builds call mcp251xfd_clks_and_vdd_disable() directly. Link: https://lore.kernel.org/all/20220207131047.282110-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
@@ -1768,10 +1768,10 @@ static inline void mcp251xfd_unregister(struct mcp251xfd_priv *priv)
|
||||
|
||||
unregister_candev(ndev);
|
||||
|
||||
pm_runtime_get_sync(ndev->dev.parent);
|
||||
pm_runtime_put_noidle(ndev->dev.parent);
|
||||
mcp251xfd_clks_and_vdd_disable(priv);
|
||||
pm_runtime_disable(ndev->dev.parent);
|
||||
if (pm_runtime_enabled(ndev->dev.parent))
|
||||
pm_runtime_disable(ndev->dev.parent);
|
||||
else
|
||||
mcp251xfd_clks_and_vdd_disable(priv);
|
||||
}
|
||||
|
||||
static const struct of_device_id mcp251xfd_of_match[] = {
|
||||
|
||||
Reference in New Issue
Block a user