[PATCH v2 2/7] usb: cdns3-ti: remove runtime PM

From: Théo Lebrun
Date: Mon Nov 20 2023 - 12:06:18 EST


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@xxxxxxxxxxx>
---
drivers/usb/cdns3/cdns3-ti.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/usb/cdns3/cdns3-ti.c b/drivers/usb/cdns3/cdns3-ti.c
index 5945c4b1e11f..dc1594acdcee 100644
--- a/drivers/usb/cdns3/cdns3-ti.c
+++ b/drivers/usb/cdns3/cdns3-ti.c
@@ -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);
}

--
2.42.0