Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1432783 > unrolled thread

Re: [PATCH 5/6] soc/tegra: pmc: Add missing of_node_put

Started byJon Hunter <jonathanh@nvidia.com>
First post2016-06-28 12:50 +0200
Last post2016-06-28 12:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 5/6] soc/tegra: pmc: Add missing of_node_put Jon Hunter <jonathanh@nvidia.com> - 2016-06-28 12:50 +0200

#1432783 — Re: [PATCH 5/6] soc/tegra: pmc: Add missing of_node_put

FromJon Hunter <jonathanh@nvidia.com>
Date2016-06-28 12:50 +0200
SubjectRe: [PATCH 5/6] soc/tegra: pmc: Add missing of_node_put
Message-ID<rOYKC-5Nk-7@gated-at.bofh.it>
On 28/06/16 11:38, Jon Hunter wrote:
> Add missing of_node_put() in PMC early initialisation function.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/soc/tegra/pmc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index 483d54623ec5..e62acaef140a 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -1572,6 +1572,8 @@ static int __init tegra_pmc_early_init(void)
>  			value &= ~PMC_CNTRL_INTR_POLARITY;
>  
>  		tegra_pmc_writel(value, PMC_CNTRL);
> +
> +		of_node_put(np);
>  	}
>  
>  	return 0;

Actually there are a couple other places we should put the node ...

diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
index 483d54623ec5..48e1de2f7aeb 100644
--- a/drivers/soc/tegra/pmc.c
+++ b/drivers/soc/tegra/pmc.c
@@ -1540,6 +1540,7 @@ static int __init tegra_pmc_early_init(void)
                 */
                if (of_address_to_resource(np, 0, &regs) < 0) {
                        pr_err("failed to get PMC registers\n");
+                       of_node_put(np);
                        return -ENXIO;
                }
        }
@@ -1547,6 +1548,7 @@ static int __init tegra_pmc_early_init(void)
        pmc->base = ioremap_nocache(regs.start, resource_size(&regs));
        if (!pmc->base) {
                pr_err("failed to map PMC registers\n");
+               of_node_put(np);
                return -ENXIO;
        }

@@ -1572,6 +1574,8 @@ static int __init tegra_pmc_early_init(void)
                        value &= ~PMC_CNTRL_INTR_POLARITY;

                tegra_pmc_writel(value, PMC_CNTRL);
+
+               of_node_put(np);
        }

        return 0;

-- 
nvpublic

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web