From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH 0/4] CPUFreq: Implement per policy instances of governors Date: Tue, 5 Feb 2013 12:04:07 +0100 Message-ID: <20130205110407.GC4827@pd.tnic> References: <20130204140908.GC15452@pd.tnic> <20130204150511.GF13909@pd.tnic> <20130204165057.GH13909@pd.tnic> <20130205091532.GA4827@pd.tnic> <20130205102721.GB4827@pd.tnic> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1360062249; bh=OvDwpOHtUv7yeHmgde/oAosa63O+9gz26DHSoPSD5NE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=S3cBMjQYhbvql9pTlQyhQzBZlTo2DV16TqP5Ya Oq55wBpuG0fUv3h1PxeP2efe2V6yzAfRDxFGiMwZuElek2+818AdyH+k2AAdaf0wjlE TBwinOKh3ccFJj8NVlleeFmzvb6nOnGT43+06Sxit4lzEqERYAvh2dZEB8g7TGmWeM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alien8.de; s=alien8; t=1360062248; bh=OvDwpOHtUv7yeHmgde/oAosa63O+9gz26DHSoPSD5NE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=V5uMOeinqjyLmSAzazhc7e3O6D4V/Lxn1ZH402 0fTARWj7ifw+ftchfIuCXsXz2ef7UknOqkf37wN3G/SrfTgVrvABiuLD7ZUktyjfB3E E9wtcd8GSMFYpHKnkbaOnEEor8ScUsispmL+HE2ilTuXH82Nxtqro5xLduu6FqE/Bs= Content-Disposition: inline In-Reply-To: Sender: cpufreq-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Viresh Kumar Cc: "Rafael J. Wysocki" , cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-dev@lists.linaro.org, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, Charles Garcia-Tobin On Tue, Feb 05, 2013 at 04:13:23PM +0530, Viresh Kumar wrote: > There isn't lot of code that we have to keep inside the macro you > suggest. Its just an if else (with single line block), which would > give the parent kobject. Nothing else. > > I didn't wanted to create a macro for just that. For me an if/else is > not that big code. Yeah, I imagine for you it isn't, no. > Anyway, if nobody else comes on my side i can create that macro for you. > But, personally i would prefer code without such macros. Here's an even cleaner way: platform_driver: init(struct cpufreq_policy *policy) { ... add_additional_sysfs_entries(policy); ... } ... static void add_additional_sysfs_entries(struct cpufreq_policy *policy) { #ifdef CONFIG_CPUFREQ_MULTIPLE_POLICIES create-folder-in-cpu/cpu*/cpufreq; ... #endif } and the platform driver will have in its Kconfig section: config CPUFREQ_PLATFORM_DRIVER_X ... select CPUFREQ_MULTIPLE_POLICIES You don't need the policy->have_multiple_policies member even. -- Regards/Gruss, Boris. Sent from a fat crate under my desk. Formatting is fine. --