[v2,2/7] usb: cdns3-ti: remove runtime PM
Commit Message
The driver does not use RPM. It enables it & gets a reference at probe.
It then undoes that on probe error or at remove.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
drivers/usb/cdns3/cdns3-ti.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
Comments
Théo Lebrun <theo.lebrun@bootlin.com> writes:
> The driver does not use RPM. It enables it & gets a reference at probe.
> It then undoes that on probe error or at remove.
...which is a fairly standard thing to do for a rudimentary runtime PM
support on platforms that use power domains.
This will likely (almost surely) break other platforms.
Without a runtime PM get call, the power domain that this device is in
could be powered off without this driver ever knowing about it, causing
a crash as soon as the driver is used after the domain is turned off.
Kevin
@@ -135,13 +135,6 @@ static int cdns_ti_probe(struct platform_device *pdev)
rate_code = i;
- pm_runtime_enable(dev);
- error = pm_runtime_get_sync(dev);
- if (error < 0) {
- dev_err(dev, "pm_runtime_get_sync failed: %d\n", error);
- goto err;
- }
-
/* assert RESET */
reg = cdns_ti_readl(data, USBSS_W1);
reg &= ~USBSS_W1_PWRUP_RST;
@@ -179,16 +172,10 @@ static int cdns_ti_probe(struct platform_device *pdev)
error = of_platform_populate(node, NULL, NULL, dev);
if (error) {
dev_err(dev, "failed to create children: %d\n", error);
- goto err;
+ return error;
}
return 0;
-
-err:
- pm_runtime_put_sync(data->dev);
- pm_runtime_disable(data->dev);
-
- return error;
}
static int cdns_ti_remove_core(struct device *dev, void *c)
@@ -205,8 +192,6 @@ static void cdns_ti_remove(struct platform_device *pdev)
struct device *dev = &pdev->dev;
device_for_each_child(dev, NULL, cdns_ti_remove_core);
- pm_runtime_put_sync(dev);
- pm_runtime_disable(dev);
platform_set_drvdata(pdev, NULL);
}