From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Subject: Re: [PATCH v3 13/15] cpufreq: Add cpufreq driver for Tegra124 Date: Tue, 19 Aug 2014 22:44:00 +0300 Message-ID: <53F3A900.8010805@nvidia.com> References: <1408419205-10048-1-git-send-email-tuomas.tynkkynen@iki.fi> <1408419205-10048-14-git-send-email-tuomas.tynkkynen@iki.fi> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Viresh Kumar , Tuomas Tynkkynen Cc: "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Linux Kernel Mailing List , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Stephen Warren , Thierry Reding , Peter De Schrijver , Prashant Gaikwad , Mike Turquette , "Rafael J. Wysocki" , Paul Walmsley , Vince Hsu , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-pm@vger.kernel.org On 19/08/14 08:55, Viresh Kumar wrote: > On 19 August 2014 09:03, Tuomas Tynkkynen wrote: >> - use 'select GENERIC_CPUFREQ_CPU0', not depends > > Bad :( > > It *has* to be a depends here, its not optional. That was outcome of the > chat we had last time, if I remember it well.. Okay, I misread that conversation then. >> --- > > You don't need to add these --- here, just add a blank line and git > will take care of things for you :) There's actually a (mis-?)feature in git format-patch: a literal '---' line in a commit message won't be escaped, so the patch notes can be written in the commit message directly so the patch files don't need to be modified by hand. >> drivers/cpufreq/Kconfig.arm | 8 ++ >> drivers/cpufreq/Makefile | 1 + >> drivers/cpufreq/tegra124-cpufreq.c | 206 +++++++++++++++++++++++++++++++++++++ >> 3 files changed, 215 insertions(+) >> create mode 100644 drivers/cpufreq/tegra124-cpufreq.c >> [...] >> +static int tegra124_cpufreq_probe(struct platform_device *pdev) >> +{ > >> + priv->vdd_cpu_reg = regulator_get(get_cpu_device(0), "vdd-cpu"); > > get_cpu_device() can fail as well, and so you may want to check its return > value as well.. > Oh, right. >> +static int __init tegra_cpufreq_init(void) >> +{ >> + int ret; >> + struct platform_device *pdev; >> + >> + if (!of_match_machine(soc_of_matches)) >> + return -ENODEV; > > You may want to add a comment here on why you chose to add another layer > of platform device/driver.. i.e. to catch -EPROBE_DEFER from clk-APIs.. > Yes, a good idea. -- nvpublic -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: ttynkkynen@nvidia.com (Tuomas Tynkkynen) Date: Tue, 19 Aug 2014 22:44:00 +0300 Subject: [PATCH v3 13/15] cpufreq: Add cpufreq driver for Tegra124 In-Reply-To: References: <1408419205-10048-1-git-send-email-tuomas.tynkkynen@iki.fi> <1408419205-10048-14-git-send-email-tuomas.tynkkynen@iki.fi> Message-ID: <53F3A900.8010805@nvidia.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 19/08/14 08:55, Viresh Kumar wrote: > On 19 August 2014 09:03, Tuomas Tynkkynen wrote: >> - use 'select GENERIC_CPUFREQ_CPU0', not depends > > Bad :( > > It *has* to be a depends here, its not optional. That was outcome of the > chat we had last time, if I remember it well.. Okay, I misread that conversation then. >> --- > > You don't need to add these --- here, just add a blank line and git > will take care of things for you :) There's actually a (mis-?)feature in git format-patch: a literal '---' line in a commit message won't be escaped, so the patch notes can be written in the commit message directly so the patch files don't need to be modified by hand. >> drivers/cpufreq/Kconfig.arm | 8 ++ >> drivers/cpufreq/Makefile | 1 + >> drivers/cpufreq/tegra124-cpufreq.c | 206 +++++++++++++++++++++++++++++++++++++ >> 3 files changed, 215 insertions(+) >> create mode 100644 drivers/cpufreq/tegra124-cpufreq.c >> [...] >> +static int tegra124_cpufreq_probe(struct platform_device *pdev) >> +{ > >> + priv->vdd_cpu_reg = regulator_get(get_cpu_device(0), "vdd-cpu"); > > get_cpu_device() can fail as well, and so you may want to check its return > value as well.. > Oh, right. >> +static int __init tegra_cpufreq_init(void) >> +{ >> + int ret; >> + struct platform_device *pdev; >> + >> + if (!of_match_machine(soc_of_matches)) >> + return -ENODEV; > > You may want to add a comment here on why you chose to add another layer > of platform device/driver.. i.e. to catch -EPROBE_DEFER from clk-APIs.. > Yes, a good idea. -- nvpublic From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753411AbaHSToJ (ORCPT ); Tue, 19 Aug 2014 15:44:09 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:18591 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752652AbaHSToH (ORCPT ); Tue, 19 Aug 2014 15:44:07 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Tue, 19 Aug 2014 12:34:29 -0700 Message-ID: <53F3A900.8010805@nvidia.com> Date: Tue, 19 Aug 2014 22:44:00 +0300 From: Tuomas Tynkkynen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Viresh Kumar , Tuomas Tynkkynen CC: "linux-tegra@vger.kernel.org" , Linux Kernel Mailing List , "linux-arm-kernel@lists.infradead.org" , "linux-pm@vger.kernel.org" , Stephen Warren , Thierry Reding , Peter De Schrijver , Prashant Gaikwad , Mike Turquette , "Rafael J. Wysocki" , Paul Walmsley , Vince Hsu , "devicetree@vger.kernel.org" Subject: Re: [PATCH v3 13/15] cpufreq: Add cpufreq driver for Tegra124 References: <1408419205-10048-1-git-send-email-tuomas.tynkkynen@iki.fi> <1408419205-10048-14-git-send-email-tuomas.tynkkynen@iki.fi> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19/08/14 08:55, Viresh Kumar wrote: > On 19 August 2014 09:03, Tuomas Tynkkynen wrote: >> - use 'select GENERIC_CPUFREQ_CPU0', not depends > > Bad :( > > It *has* to be a depends here, its not optional. That was outcome of the > chat we had last time, if I remember it well.. Okay, I misread that conversation then. >> --- > > You don't need to add these --- here, just add a blank line and git > will take care of things for you :) There's actually a (mis-?)feature in git format-patch: a literal '---' line in a commit message won't be escaped, so the patch notes can be written in the commit message directly so the patch files don't need to be modified by hand. >> drivers/cpufreq/Kconfig.arm | 8 ++ >> drivers/cpufreq/Makefile | 1 + >> drivers/cpufreq/tegra124-cpufreq.c | 206 +++++++++++++++++++++++++++++++++++++ >> 3 files changed, 215 insertions(+) >> create mode 100644 drivers/cpufreq/tegra124-cpufreq.c >> [...] >> +static int tegra124_cpufreq_probe(struct platform_device *pdev) >> +{ > >> + priv->vdd_cpu_reg = regulator_get(get_cpu_device(0), "vdd-cpu"); > > get_cpu_device() can fail as well, and so you may want to check its return > value as well.. > Oh, right. >> +static int __init tegra_cpufreq_init(void) >> +{ >> + int ret; >> + struct platform_device *pdev; >> + >> + if (!of_match_machine(soc_of_matches)) >> + return -ENODEV; > > You may want to add a comment here on why you chose to add another layer > of platform device/driver.. i.e. to catch -EPROBE_DEFER from clk-APIs.. > Yes, a good idea. -- nvpublic