summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-10-13 10:48:40 -0700
committerTony Lindgren <tony@atomide.com>2017-10-13 10:48:40 -0700
commit684be5a48f4950cb8823b4c4b935515a75615498 (patch)
tree4b9196299377f97eda3e9b28ec53e33efdad73e8 /drivers/bus
parenta4a5d493ebbc680121b584afcaa2c955b6281d0c (diff)
bus: ti-sysc: Fix unbalanced pm_runtime_enable by adding remove
Looks like we're missing remove() that's needed if a driver instance rebound. Otherwise we will get "Unbalanced pm_runtime_enable!". Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/ti-sysc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index 8b95d0f0c319..c3c76a1ea8a8 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -529,6 +529,30 @@ unprepare:
return error;
}
+static int sysc_remove(struct platform_device *pdev)
+{
+ struct sysc *ddata = platform_get_drvdata(pdev);
+ int error;
+
+ error = pm_runtime_get_sync(ddata->dev);
+ if (error < 0) {
+ pm_runtime_put_noidle(ddata->dev);
+ pm_runtime_disable(ddata->dev);
+ goto unprepare;
+ }
+
+ of_platform_depopulate(&pdev->dev);
+
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
+unprepare:
+ sysc_unprepare(ddata);
+
+ return 0;
+}
+
static const struct of_device_id sysc_match[] = {
{ .compatible = "ti,sysc-omap2" },
{ .compatible = "ti,sysc-omap4" },
@@ -546,6 +570,7 @@ MODULE_DEVICE_TABLE(of, sysc_match);
static struct platform_driver sysc_driver = {
.probe = sysc_probe,
+ .remove = sysc_remove,
.driver = {
.name = "ti-sysc",
.of_match_table = sysc_match,