Skip to contentSkip to conversation

usb: xhci: tegra: Power-off power-domains on removal

PATCH New Mathias Nyman 1 participant 1 message Oct 16, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 usb: xhci: tegra: Power-off power-domains on removal

From: Jon Hunter <[email protected]>

Currently the XUSB power domains used by the Tegra xHCI controller are never powered off on the removal of the driver, however, they will be powered off on probe failure. Update the removal code to be consistent with the probe failure path to power off the XUSB power domains.

---
 drivers/usb/host/xhci-tegra.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/usb/host/xhci-tegra.c +5 -0
index 4ee510a..920a50a 100644
@@ -1249,6 +1249,11 @@ static int tegra_xusb_remove(struct platform_device *pdev)
 	pm_runtime_put_sync(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 
+	if (!pdev->dev.pm_domain) {
+		tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC);
+		tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA);
+	}
+
 	tegra_xusb_padctl_put(tegra->padctl);
 
 	return 0;