From patchwork Thu Feb 19 11:32:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 44817 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f197.google.com (mail-we0-f197.google.com [74.125.82.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AC94321554 for ; Thu, 19 Feb 2015 11:33:39 +0000 (UTC) Received: by wesw55 with SMTP id w55sf4657742wes.0 for ; Thu, 19 Feb 2015 03:33:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=YxPIr9BWJ9qELTUkqCjuX/O22R1SwReQU2xibR21DUI=; b=TrM4nsI0ZaV5ABv6qpDocF2kJjQI4NZPVkFahjLy0ulvsMwTm3ZZBkfFUkF6wv5X9p sAvsej9WQdqjGrcmE+n6yYFknW68EWUEmvm3mIrpYL74I1bNTy12kqb0W6kbkSndbYFN HXxi4sddlUppf0mi+TIhWNt/AGcAavAC4ZV7An8s/OonFepcZtmrQ8lAjXaexwVPwDeW ci4zsG9XnoS5Kyi75YDuFq7Qlkwm/LnTRYBPy7kEr6efh2BZY+A5aAqlYc/Tl5Gjhqvn CNG4D28HAxZMnOyZfSKT3hTIei1myGJWzK+H8cK0k53jVH9R2ZAgCYvckC7fzXOsnUz6 kqWA== X-Gm-Message-State: ALoCoQm+oChtugRWZVlJw2QlK6oA4agS/4bTJGAIl2kn9njVeSjzHBIMPWK6xt1hMlamILRd9Ua/ X-Received: by 10.152.4.229 with SMTP id n5mr511422lan.1.1424345618967; Thu, 19 Feb 2015 03:33:38 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.231 with SMTP id jf7ls141702lac.92.gmail; Thu, 19 Feb 2015 03:33:38 -0800 (PST) X-Received: by 10.112.154.199 with SMTP id vq7mr3280251lbb.99.1424345618788; Thu, 19 Feb 2015 03:33:38 -0800 (PST) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id m6si15234771lbs.23.2015.02.19.03.33.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 03:33:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbvn10 with SMTP id n10so6894271lbv.6 for ; Thu, 19 Feb 2015 03:33:38 -0800 (PST) X-Received: by 10.112.181.41 with SMTP id dt9mr3719035lbc.56.1424345618366; Thu, 19 Feb 2015 03:33:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp431504lbj; Thu, 19 Feb 2015 03:33:37 -0800 (PST) X-Received: by 10.70.135.68 with SMTP id pq4mr7006424pdb.80.1424345615731; Thu, 19 Feb 2015 03:33:35 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si9194519pdq.28.2015.02.19.03.33.34; Thu, 19 Feb 2015 03:33:35 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbbBSLdb (ORCPT + 11 others); Thu, 19 Feb 2015 06:33:31 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:43433 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753237AbbBSLd3 (ORCPT ); Thu, 19 Feb 2015 06:33:29 -0500 Received: by pdev10 with SMTP id v10so8252347pde.10 for ; Thu, 19 Feb 2015 03:33:29 -0800 (PST) X-Received: by 10.68.135.37 with SMTP id pp5mr6661906pbb.105.1424345609199; Thu, 19 Feb 2015 03:33:29 -0800 (PST) Received: from localhost ([122.172.249.58]) by mx.google.com with ESMTPSA id dg5sm23394755pbb.67.2015.02.19.03.33.27 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 19 Feb 2015 03:33:28 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, sboyd@codeaurora.org, prarit@redhat.com, skannan@codeaurora.org, Viresh Kumar Subject: [PATCH V2 02/20] cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev() Date: Thu, 19 Feb 2015 17:02:04 +0530 Message-Id: X-Mailer: git-send-email 2.3.0.rc0.44.ga94655d In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , cpufreq_add_dev() is an unnecessary wrapper over __cpufreq_add_dev(). Merge them. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index fc51b8fbb0b0..4884caf92bff 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1125,7 +1125,16 @@ static int update_policy_cpu(struct cpufreq_policy *policy, unsigned int cpu, return 0; } -static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) +/** + * cpufreq_add_dev - add a CPU device + * + * Adds the cpufreq interface for a CPU device. + * + * The Oracle says: try running cpufreq registration/unregistration concurrently + * with with cpu hotplugging and all hell will break loose. Tried to clean this + * mess up, but more thorough testing is needed. - Mathieu + */ +static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) { unsigned int j, cpu = dev->id; int ret = -ENOMEM; @@ -1336,20 +1345,6 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) return ret; } -/** - * cpufreq_add_dev - add a CPU device - * - * Adds the cpufreq interface for a CPU device. - * - * The Oracle says: try running cpufreq registration/unregistration concurrently - * with with cpu hotplugging and all hell will break loose. Tried to clean this - * mess up, but more thorough testing is needed. - Mathieu - */ -static int cpufreq_add_dev(struct device *dev, struct subsys_interface *sif) -{ - return __cpufreq_add_dev(dev, sif); -} - static int __cpufreq_remove_dev_prepare(struct device *dev, struct subsys_interface *sif) { @@ -2328,7 +2323,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, if (dev) { switch (action & ~CPU_TASKS_FROZEN) { case CPU_ONLINE: - __cpufreq_add_dev(dev, NULL); + cpufreq_add_dev(dev, NULL); break; case CPU_DOWN_PREPARE: @@ -2340,7 +2335,7 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb, break; case CPU_DOWN_FAILED: - __cpufreq_add_dev(dev, NULL); + cpufreq_add_dev(dev, NULL); break; } }