Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752851Ab3CEKxN (ORCPT ); Tue, 5 Mar 2013 05:53:13 -0500 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:54113 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469Ab3CEKxM (ORCPT ); Tue, 5 Mar 2013 05:53:12 -0500 Date: Tue, 5 Mar 2013 10:52:51 +0000 From: Russell King - ARM Linux To: Viresh Kumar Cc: rjw@sisk.pl, Steve.Bannister@arm.com, linux-pm@vger.kernel.org, Sudeep KarkadaNagesha , Liviu.Dudau@arm.com, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, robin.randhawa@arm.com, linux-arm-kernel@lists.infradead.org, mark.hambleton@broadcom.com, linaro-kernel@lists.linaro.org, charles.garcia-tobin@arm.com Subject: Re: [PATCH] cpufreq: ARM big LITTLE: Add generic cpufreq driver and its DT glue Message-ID: <20130305105251.GL17833@n2100.arm.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1210 Lines: 38 On Tue, Mar 05, 2013 at 12:52:41PM +0800, Viresh Kumar wrote: > +static void put_cluster_clk_and_freq_table(u32 cluster) > +{ > + if (!atomic_dec_return(&cluster_usage[cluster])) { > + clk_put(clk[cluster]); > + clk[cluster] = NULL; What's the point in setting the clk to NULL? > +static int get_cluster_clk_and_freq_table(u32 cluster) > +{ > + char name[9] = "cluster"; > + int count; > + > + if (atomic_inc_return(&cluster_usage[cluster]) != 1) > + return 0; > + > + freq_table[cluster] = arm_bL_ops->get_freq_tbl(cluster, &count); > + if (!freq_table[cluster]) > + goto atomic_dec; > + > + name[7] = cluster + '0'; > + clk[cluster] = clk_get(NULL, name); > + if (!IS_ERR_OR_NULL(clk[cluster])) { NAK. Two reasons. 1. IS_ERR_OR_NULL. You know about this, it's been on the list several times. 2. Maybe clk_get_sys() rather than clk_get() and use a sensible device name ("cpu-cluster.%u" maybe) rather than a connection name with a NULL device? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/