Skip to contentSkip to conversation

usb: cdns3: imx: improve driver .remove API

PATCH New Peter Chen 1 participant 1 message Dec 10, 2020

Subsystems (3)
lore
Share & tools
lore

Peter Chen

author maintainer
#0 lore raw

PATCH 1/1 usb: cdns3: imx: improve driver .remove API

From: Peter Chen <[email protected]>

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

---
 drivers/usb/cdns3/cdns3-imx.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/cdns3/cdns3-imx.c +5 -0
index ca8e2ad2913a..f03562c76a50 100644
@@ -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;
Signature · 1 line
2.17.1