can: c_can: move runtime PM enable/disable to c_can_platform
authorTong Zhang <ztong0001@gmail.com>
Tue, 2 Mar 2021 02:55:40 +0000 (21:55 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:32:00 +0000 (14:32 +0200)
commit4fcf59c2499039893149c5ad18a869249fe860af
tree4bbb0c2031480a1072f144028bb6187062ec84e3
parent524320e8034a9100bea04f311297a395f31bb857
can: c_can: move runtime PM enable/disable to c_can_platform

[ Upstream commit 6e2fe01dd6f98da6cae8b07cd5cfa67abc70d97d ]

Currently doing modprobe c_can_pci will make the kernel complain:

    Unbalanced pm_runtime_enable!

this is caused by pm_runtime_enable() called before pm is initialized.

This fix is similar to 227619c3ff7c, move those pm_enable/disable code
to c_can_platform.

Fixes: 4cdd34b26826 ("can: c_can: Add runtime PM support to Bosch C_CAN/D_CAN controller")
Link: http://lore.kernel.org/r/20210302025542.987600-1-ztong0001@gmail.com
Signed-off-by: Tong Zhang <ztong0001@gmail.com>
Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/can/c_can/c_can.c
drivers/net/can/c_can/c_can_platform.c