From patchwork Thu Jan 28 08:20:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 60682 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp331808lbb; Thu, 28 Jan 2016 00:22:22 -0800 (PST) X-Received: by 10.67.7.3 with SMTP id cy3mr2707155pad.100.1453969342330; Thu, 28 Jan 2016 00:22:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vz3si15348560pab.93.2016.01.28.00.22.22; Thu, 28 Jan 2016 00:22:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965875AbcA1IWU (ORCPT + 30 others); Thu, 28 Jan 2016 03:22:20 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:36145 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965624AbcA1IVk (ORCPT ); Thu, 28 Jan 2016 03:21:40 -0500 Received: by mail-pf0-f175.google.com with SMTP id n128so19738413pfn.3 for ; Thu, 28 Jan 2016 00:21:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=d2zRa+Pyx/UW0mMtkRV8WTslP6a0HTvMhS/AnaPpX28=; b=DCK+H892GOz9t2eef6Ptx67tpHdKGN4BInxuYd/zi15Y6j9bdAicivZ+9LVvPR5Jii qaCbVKmu5cqPFxt3J8tbzwIHCYtSk/9BJue0kMI+1HWArmTYJE0omasFQmn69kVRsfmo DWFUgvxU4opvdYZbke4wLc8Vh5zup9JvOhrec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=d2zRa+Pyx/UW0mMtkRV8WTslP6a0HTvMhS/AnaPpX28=; b=MBzVRYjuaoqY06ip34/6e/SsgcRHH+aQfVkLyAPNtmMBKK7yL7fgrGPxpfDP7qc+Zo 5hI2hdAnUffxr/BqSa1c6YZuuHUZirn4616LRnCzZkwXiqmlI3dzlOHplnK3rrC2geZo j4BbiUTtldAn3KKWCjvjR+9iqQ1N1aNG6WKG3NbJTMFoo7bXn1jejoivWa8ZLzgMjbdn MUq0FwKJpE8ZvniVGxGEIYQeJObA5BSPZ2XDHMrr67g8v1pvRqeIbt2TChOHTn4pywSZ +NJ/UHgXrFNUumcPk7F6qbw4+ENw3C0ykMN54SG/n/3pAQt0oNBDam1y1vHoTqBRqddD xzxw== X-Gm-Message-State: AG10YOSqeQsXSclvBwYm05Uj/SnbULLSu/vO+mVippMaRyZQ5fzmSmUUgakv4oMlwXMZWhyc X-Received: by 10.98.8.28 with SMTP id c28mr2718745pfd.56.1453969299799; Thu, 28 Jan 2016 00:21:39 -0800 (PST) Received: from localhost ([122.171.121.234]) by smtp.gmail.com with ESMTPSA id ud10sm14215762pab.27.2016.01.28.00.21.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 00:21:39 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Stephen Boyd , nm@ti.com, Viresh Kumar , linux-kernel@vger.kernel.org (open list) Subject: [PATCH V2 15/16] cpufreq: dt: drop references to DT node Date: Thu, 28 Jan 2016 13:50:44 +0530 Message-Id: X-Mailer: git-send-email 2.7.0.79.gdc08a19 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We don't need to get reference to DT node now, lets drop it. Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd --- drivers/cpufreq/cpufreq-dt.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) -- 2.7.0.79.gdc08a19 diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index 13338365f24e..5ea41518df63 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -33,7 +33,6 @@ struct private_data { struct device *cpu_dev; struct regulator *cpu_reg; struct thermal_cooling_device *cdev; - unsigned int voltage_tolerance; /* in percentage */ const char *reg_name; }; @@ -166,7 +165,6 @@ static int allocate_resources(int cpu, struct device **cdev, static int cpufreq_init(struct cpufreq_policy *policy) { struct cpufreq_frequency_table *freq_table; - struct device_node *np; struct private_data *priv; struct device *cpu_dev; struct regulator *cpu_reg; @@ -183,13 +181,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) return ret; } - np = of_node_get(cpu_dev->of_node); - if (!np) { - dev_err(cpu_dev, "failed to find cpu%d node\n", policy->cpu); - ret = -ENOENT; - goto out_put_reg_clk; - } - /* Get OPP-sharing information from "operating-points-v2" bindings */ ret = dev_pm_opp_of_get_sharing_cpus(cpu_dev, policy->cpus); if (ret) { @@ -200,7 +191,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) if (ret == -ENOENT) opp_v1 = true; else - goto out_node_put; + goto out_put_reg_clk; } /* @@ -210,7 +201,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) name = find_supply_name(cpu_dev); if (IS_ERR(name)) { ret = PTR_ERR(name); - goto out_node_put; + goto out_put_reg_clk; } if (name) { @@ -218,7 +209,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) if (ret) { dev_err(cpu_dev, "Failed to set regulator for cpu%d: %d\n", policy->cpu, ret); - goto out_node_put; + goto out_put_reg_clk; } } @@ -268,7 +259,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) } priv->reg_name = name; - of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { @@ -310,8 +300,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = transition_latency; - of_node_put(np); - return 0; out_free_cpufreq_table: @@ -322,8 +310,6 @@ static int cpufreq_init(struct cpufreq_policy *policy) dev_pm_opp_of_cpumask_remove_table(policy->cpus); if (name) dev_pm_opp_put_regulator(cpu_dev); -out_node_put: - of_node_put(np); out_put_reg_clk: clk_put(cpu_clk); if (!IS_ERR(cpu_reg))