From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756803AbcBHWzT (ORCPT ); Mon, 8 Feb 2016 17:55:19 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:49646 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbcBHWzQ (ORCPT ); Mon, 8 Feb 2016 17:55:16 -0500 Date: Mon, 8 Feb 2016 14:55:15 -0800 From: Stephen Boyd To: Viresh Kumar Cc: Rafael Wysocki , linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, nm@ti.com, open list Subject: Re: [PATCH V2 11/16] cpufreq: dt: Pass regulator name to the OPP core Message-ID: <20160208225515.GF10791@codeaurora.org> References: <20160202023418.GK4848@codeaurora.org> <20160202061013.GC31828@vireshk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160202061013.GC31828@vireshk> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02, Viresh Kumar wrote: > static int allocate_resources(int cpu, struct device **cdev, > struct regulator **creg, struct clk **cclk) > { > @@ -200,6 +225,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) > unsigned long min_uV = ~0, max_uV = 0; > unsigned int transition_latency; > bool opp_v1 = false; > + const char *name = NULL; Is this initialization necessary? > int ret; > > ret = allocate_resources(policy->cpu, &cpu_dev, &cpu_reg, &cpu_clk); > @@ -229,6 +255,25 @@ static int cpufreq_init(struct cpufreq_policy *policy) > } > > /* > + * OPP layer will be taking care of regulators now, but it needs to know > + * the name of the regulator first. > + */ > + name = find_supply_name(cpu_dev, np); > + if (IS_ERR(name)) { This looks to never happen? > + ret = PTR_ERR(name); > + goto out_node_put; > + } > + > + if (name) { > + ret = dev_pm_opp_set_regulator(cpu_dev, name); -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project