From patchwork Tue Nov 25 10:34:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41457 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BC51D25E18 for ; Tue, 25 Nov 2014 10:35:57 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id q1sf221744lam.5 for ; Tue, 25 Nov 2014 02:35:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=UQKA05SEpo6JEIiNj6obLFlE0U2WZix1oqu948FoQdU=; b=P+5osJmfKODKzUwu7JL+NCbjITVsXXXvIags2cr8rq8iQZosvgfItmw38aIbg8VDtE RdA8an+6gUyEU+OWRnerCuFCSmNq9haRGdf+qNi+1ydd+uxSH4hUtMGx2kN82y8rfNOS 3d4zDnqN1FZhEsfp2tFBKxKcj+vX/fuzkhx2GDp2dlAwPLis/RS9TONjrMccds36lRto ZFNbJ2sUlrhKnQRKnboyquW231+8js9+5YB3GiBorR3zsw4+AscaPHf+jF4UG1h2G4to ax0wdm/QGk2iVcj5FVO0ns27ndIS95KCZ8MLvNCi9dcl77Rnl3kC40fV98lNxWlI4mQY utrw== X-Gm-Message-State: ALoCoQmhH75xJBVTw7KdEFMDBBlSC/9k9RofZ24lvDz4v8C9oJ4ZwC3/aAXPqkbL8cXvRzt0FHBg X-Received: by 10.180.82.34 with SMTP id f2mr5343620wiy.1.1416911756721; Tue, 25 Nov 2014 02:35:56 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.200 with SMTP id h8ls102441lae.76.gmail; Tue, 25 Nov 2014 02:35:56 -0800 (PST) X-Received: by 10.152.120.167 with SMTP id ld7mr24907826lab.77.1416911756368; Tue, 25 Nov 2014 02:35:56 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id kh7si928140lbc.17.2014.11.25.02.35.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Nov 2014 02:35:56 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id 10so245841lbg.36 for ; Tue, 25 Nov 2014 02:35:56 -0800 (PST) X-Received: by 10.112.138.137 with SMTP id qq9mr25191691lbb.80.1416911756236; Tue, 25 Nov 2014 02:35:56 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp410757lbc; Tue, 25 Nov 2014 02:35:55 -0800 (PST) X-Received: by 10.70.98.200 with SMTP id ek8mr14298616pdb.163.1416911753644; Tue, 25 Nov 2014 02:35:53 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mk8si1367241pdb.23.2014.11.25.02.35.52 for ; Tue, 25 Nov 2014 02:35:53 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752436AbaKYKfw (ORCPT + 12 others); Tue, 25 Nov 2014 05:35:52 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:60221 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752414AbaKYKfv (ORCPT ); Tue, 25 Nov 2014 05:35:51 -0500 Received: by mail-pd0-f169.google.com with SMTP id fp1so325370pdb.14 for ; Tue, 25 Nov 2014 02:35:51 -0800 (PST) X-Received: by 10.70.126.194 with SMTP id na2mr42554925pdb.39.1416911751417; Tue, 25 Nov 2014 02:35:51 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id x16sm1082796pbt.70.2014.11.25.02.35.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 25 Nov 2014 02:35:50 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, stefan.wahren@i2se.com, nm@ti.com, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, Viresh Kumar Subject: [PATCH 6/8] cpufreq-dt: free OPP table created during ->init() Date: Tue, 25 Nov 2014 16:04:21 +0530 Message-Id: <1ac3e8c67c7bd2a962aed6561693d16ca5cd9db9.1416910766.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , OPP layer now supports freeing of OPPs and we should free them once they aren't useful anymore. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq-dt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 8cba13d..f44419c 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -215,7 +215,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) { ret = -ENOMEM; - goto out_put_node; + goto out_free_opp; } of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance); @@ -310,7 +310,8 @@ static int cpufreq_init(struct cpufreq_policy *policy) dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); out_free_priv: kfree(priv); -out_put_node: +out_free_opp: + of_free_opp_table(cpu_dev); of_node_put(np); out_put_reg_clk: clk_put(cpu_clk); @@ -326,6 +327,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy) cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); + of_free_opp_table(priv->cpu_dev); clk_put(policy->clk); if (!IS_ERR(priv->cpu_reg)) regulator_put(priv->cpu_reg);