Commit 48454460 authored by yu kuai's avatar yu kuai Committed by Shawn Guo

ARM: imx6: add missing put_device() call in imx6q_suspend_init()

if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
corresponding put_device(). Thus add a jump target to fix the exception
handling for this function implementation.
Signed-off-by: default avataryu kuai <yukuai3@huawei.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 586745f1
...@@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) ...@@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
if (!ocram_pool) { if (!ocram_pool) {
pr_warn("%s: ocram pool unavailable!\n", __func__); pr_warn("%s: ocram pool unavailable!\n", __func__);
ret = -ENODEV; ret = -ENODEV;
goto put_node; goto put_device;
} }
ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE); ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE);
if (!ocram_base) { if (!ocram_base) {
pr_warn("%s: unable to alloc ocram!\n", __func__); pr_warn("%s: unable to alloc ocram!\n", __func__);
ret = -ENOMEM; ret = -ENOMEM;
goto put_node; goto put_device;
} }
ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base); ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base);
...@@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) ...@@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat); ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat);
if (ret) { if (ret) {
pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret); pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret);
goto put_node; goto put_device;
} }
ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat); ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat);
...@@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) ...@@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
&imx6_suspend, &imx6_suspend,
MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info));
goto put_node; goto put_device;
pl310_cache_map_failed: pl310_cache_map_failed:
iounmap(pm_info->gpc_base.vbase); iounmap(pm_info->gpc_base.vbase);
...@@ -580,6 +580,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) ...@@ -580,6 +580,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata)
iounmap(pm_info->src_base.vbase); iounmap(pm_info->src_base.vbase);
src_map_failed: src_map_failed:
iounmap(pm_info->mmdc_base.vbase); iounmap(pm_info->mmdc_base.vbase);
put_device:
put_device(&pdev->dev);
put_node: put_node:
of_node_put(node); of_node_put(node);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment