diff mbox series

[1/1] usb: cdns3: imx: improve driver .remove API

Message ID 20201210133321.20328-1-peter.chen@kernel.org
State New
Headers show
Series [1/1] usb: cdns3: imx: improve driver .remove API | expand

Commit Message

Peter Chen Dec. 10, 2020, 1:33 p.m. UTC
From: Peter Chen <peter.chen@nxp.com>

Keep the runtime active during the remove operation, and disable
related clocks.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/cdns3/cdns3-imx.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/cdns3-imx.c b/drivers/usb/cdns3/cdns3-imx.c
index ca8e2ad2913a..f03562c76a50 100644
--- a/drivers/usb/cdns3/cdns3-imx.c
+++ b/drivers/usb/cdns3/cdns3-imx.c
@@ -221,8 +221,13 @@  static int cdns_imx_probe(struct platform_device *pdev)
 static int cdns_imx_remove(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
+	struct cdns_imx *data = dev_get_drvdata(dev);
 
+	pm_runtime_get_sync(dev);
 	of_platform_depopulate(dev);
+	clk_bulk_disable_unprepare(data->num_clks, data->clks);
+	pm_runtime_disable(dev);
+	pm_runtime_put_noidle(dev);
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;