i2c: qup: do not disable the clocks twice in remove()
Subsystems (2)
PATCH 1/1 i2c: qup: do not disable the clocks twice in remove()
qup_i2c_remove() disables the clocks unconditionally. If the controller is already runtime suspended, the suspend callback has disabled them, so they are disabled a second time.
It also does this before i2c_del_adapter(), so transfers from client drivers in their remove() run with the clocks off.
Delete the adapter and disable runtime PM first, then disable the clocks only if the device is not runtime suspended.
Fixes 10c5a8425968 ("i2c: qup: New bus driver for the Qualcomm QUP I2C controller")
Signed-off-by Cong Nguyen <[email protected]>
--- drivers/i2c/busses/i2c-qup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/i2c/busses/i2c-qup.c +5 -3
@@ -1960,15 +1960,17 @@ static void qup_i2c_remove(struct platform_device *pdev) {struct qup_i2c_dev *qup =platform_get_drvdata (pdev); +i2c_del_adapter (&qup->adap); +pm_runtime_disable (qup->dev); +if (qup->is_dma) {dma_release_channel (qup->btx.dma);dma_release_channel (qup->brx.dma); }disable_irq (qup->irq); -qup_i2c_disable_clocks (qup); -i2c_del_adapter (&qup->adap); -pm_runtime_disable (qup->dev); +if (!pm_runtime_status_suspended (qup->dev)) +qup_i2c_disable_clocks (qup);pm_runtime_set_suspended (qup->dev); }
Signature · 1 line
2.25.1