diff options
author | Tony Lindgren <tony@atomide.com> | 2017-10-13 13:48:40 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2017-10-13 13:48:40 -0400 |
commit | 684be5a48f4950cb8823b4c4b935515a75615498 (patch) | |
tree | 4b9196299377f97eda3e9b28ec53e33efdad73e8 | |
parent | a4a5d493ebbc680121b584afcaa2c955b6281d0c (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>
-rw-r--r-- | drivers/bus/ti-sysc.c | 25 |
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: | |||
529 | return error; | 529 | return error; |
530 | } | 530 | } |
531 | 531 | ||
532 | static int sysc_remove(struct platform_device *pdev) | ||
533 | { | ||
534 | struct sysc *ddata = platform_get_drvdata(pdev); | ||
535 | int error; | ||
536 | |||
537 | error = pm_runtime_get_sync(ddata->dev); | ||
538 | if (error < 0) { | ||
539 | pm_runtime_put_noidle(ddata->dev); | ||
540 | pm_runtime_disable(ddata->dev); | ||
541 | goto unprepare; | ||
542 | } | ||
543 | |||
544 | of_platform_depopulate(&pdev->dev); | ||
545 | |||
546 | pm_runtime_dont_use_autosuspend(&pdev->dev); | ||
547 | pm_runtime_put_sync(&pdev->dev); | ||
548 | pm_runtime_disable(&pdev->dev); | ||
549 | |||
550 | unprepare: | ||
551 | sysc_unprepare(ddata); | ||
552 | |||
553 | return 0; | ||
554 | } | ||
555 | |||
532 | static const struct of_device_id sysc_match[] = { | 556 | static const struct of_device_id sysc_match[] = { |
533 | { .compatible = "ti,sysc-omap2" }, | 557 | { .compatible = "ti,sysc-omap2" }, |
534 | { .compatible = "ti,sysc-omap4" }, | 558 | { .compatible = "ti,sysc-omap4" }, |
@@ -546,6 +570,7 @@ MODULE_DEVICE_TABLE(of, sysc_match); | |||
546 | 570 | ||
547 | static struct platform_driver sysc_driver = { | 571 | static struct platform_driver sysc_driver = { |
548 | .probe = sysc_probe, | 572 | .probe = sysc_probe, |
573 | .remove = sysc_remove, | ||
549 | .driver = { | 574 | .driver = { |
550 | .name = "ti-sysc", | 575 | .name = "ti-sysc", |
551 | .of_match_table = sysc_match, | 576 | .of_match_table = sysc_match, |