summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorZhou Peng <eagle.zhou@nxp.com>2020-05-14 13:58:27 +0800
committerZhou Peng <eagle.zhou@nxp.com>2020-05-15 12:58:20 +0800
commitd6ff32fcb589083eb047d9a228e1b8e73c6d119d (patch)
tree53ce56aa904e74b0843922270f6672af4ad52460 /drivers/mxc
parent7482f2b33d0f387639309afcc68a034def47e5c2 (diff)
MLK-24009-2 arm64: imx8mp: vpu: g1/g2: fix build issue as module
release clk to avoid memory leak Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> (cherry picked from commit 76d95bf26376a7f774f2939052e3595b8d2aefdb)
Diffstat (limited to 'drivers/mxc')
-rwxr-xr-xdrivers/mxc/hantro_845/hantrodec_845s.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/mxc/hantro_845/hantrodec_845s.c b/drivers/mxc/hantro_845/hantrodec_845s.c
index a383669b6bae..d2b743a6c738 100755
--- a/drivers/mxc/hantro_845/hantrodec_845s.c
+++ b/drivers/mxc/hantro_845/hantrodec_845s.c
@@ -1988,19 +1988,14 @@ static int hantro_dev_remove(struct platform_device *pdev)
hantro_clk_enable(&dev->clk);
pm_runtime_get_sync(&pdev->dev);
-
hantrodec_cleanup(dev->core_id);
-#if 1 // FIXME: need to identify core id
- if (hantrodec_major > 0) {
- device_destroy(hantro_class, MKDEV(hantrodec_major, 0));
- class_destroy(hantro_class);
- unregister_chrdev(hantrodec_major, "hantrodec");
- hantrodec_major = 0;
- }
-#endif
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
hantro_clk_disable(&dev->clk);
+ if (!IS_ERR(dev->clk.dec))
+ clk_put(dev->clk.dec);
+ if (!IS_ERR(dev->clk.bus))
+ clk_put(dev->clk.bus);
#ifdef CONFIG_DEVICE_THERMAL_HANTRO
HANTRO_UNREG_THERMAL_NOTIFIER(&hantro_thermal_hot_notifier);
@@ -2090,8 +2085,13 @@ static int __init hantro_init(void)
static void __exit hantro_exit(void)
{
- //clk_put(hantro_clk);
platform_driver_unregister(&mxchantro_driver);
+ if (hantrodec_major > 0) {
+ device_destroy(hantro_class, MKDEV(hantrodec_major, 0));
+ class_destroy(hantro_class);
+ unregister_chrdev(hantrodec_major, "hantrodec");
+ hantrodec_major = 0;
+ }
}
module_init(hantro_init);