From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935995AbdCJKFS (ORCPT ); Fri, 10 Mar 2017 05:05:18 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35855 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935331AbdCJKFQ (ORCPT ); Fri, 10 Mar 2017 05:05:16 -0500 Date: Fri, 10 Mar 2017 15:35:11 +0530 From: Viresh Kumar To: Andy Tang Cc: "rjw@rjwysocki.net" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] cpufreq: qoriq: enhance bus frequency calculation Message-ID: <20170310100511.GD3341@vireshk-i7> References: <1489047306-31818-1-git-send-email-andy.tang@nxp.com> <20170309093917.GB3341@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10-03-17, 01:44, Andy Tang wrote: > > Will this always work? If yes, then what about dropping the code parsing DT > > completely ? That is, just rely on clk_get_rate() in all cases. > > > We put all the clock tree configuration in driver, not in dts. > cg-pll0-div1 is hardcoded in driver since we don't depend on dts. > We kind of don't have other choices but use the hardcode clock name > here too. Looks like you misread my comment. Let me try again. Will it be fine to write get_bus_freq() this way? static u32 get_bus_freq(void) { struct clk *pltclk; /* get platform freq by its clock name */ pltclk = clk_get(NULL, "cg-pll0-div1"); if (IS_ERR(pltclk)) { pr_err("%s: can't get bus frequency %ld\n", __func__, PTR_ERR(pltclk)); return PTR_ERR(pltclk); } return clk_get_rate(pltclk); } -- viresh