From patchwork Tue Jan 27 08:36:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 43834 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 502B72409D for ; Tue, 27 Jan 2015 08:37:58 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id q59sf6824712wes.1 for ; Tue, 27 Jan 2015 00:37:57 -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=mpjO1OtFx9cvNufShXxnoGyLevBmKeSJVvSHccEx0/w=; b=XTxIo1mD1Xmb5LZwhv66J1Qc38MqS5afrShO/84qq/do0NPywIXx8CO+ImmzaOX9Oy i8ZmfIVKpe0GGKLztz6pe7BacmXihBg/c0xzedZpWuK9OHajhBjsfMgyrTFCtXd5rRDP 0Q3ZIN75xxo/AI6MupgLqAkBIrlcCl8IU29gmrnxXwb5FLQcA7cRMfXYaBQ/0X0Vxmva H5sogS22QKCdA0t37YQbiA2w29j05U3m+PeOWZliXwra7Qps1fSFLJ78SmkozXY/h2Bt mk0weOdNLO391XKowuuX5nBcKuHek0/Tu65NwaeoxcXAL4Gr/xggy3uHvPHNsy3XOc0E FL1A== X-Gm-Message-State: ALoCoQmQZh8dc8J57bbyqTkTRthcjDDgfEU0AHnvV49iRmgW7YZPtHMsTWt0kzpr+/7oKb5/+PLz X-Received: by 10.112.162.35 with SMTP id xx3mr33181lbb.16.1422347877522; Tue, 27 Jan 2015 00:37:57 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.220.164 with SMTP id px4ls3601lac.34.gmail; Tue, 27 Jan 2015 00:37:57 -0800 (PST) X-Received: by 10.112.144.136 with SMTP id sm8mr27751lbb.95.1422347877308; Tue, 27 Jan 2015 00:37:57 -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 f10si547244laf.66.2015.01.27.00.37.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 Jan 2015 00:37:57 -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 mail-lb0-f179.google.com with SMTP id 10so11813649lbg.10 for ; Tue, 27 Jan 2015 00:37:57 -0800 (PST) X-Received: by 10.152.6.132 with SMTP id b4mr65677laa.59.1422347877218; Tue, 27 Jan 2015 00:37:57 -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 h5csp1025669lbj; Tue, 27 Jan 2015 00:37:56 -0800 (PST) X-Received: by 10.70.132.39 with SMTP id or7mr207085pdb.90.1422347870854; Tue, 27 Jan 2015 00:37:50 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si627522pdk.182.2015.01.27.00.37.49; Tue, 27 Jan 2015 00:37:50 -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 S1757931AbbA0Iht (ORCPT + 11 others); Tue, 27 Jan 2015 03:37:49 -0500 Received: from mail-pd0-f173.google.com ([209.85.192.173]:42354 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757922AbbA0Ihs (ORCPT ); Tue, 27 Jan 2015 03:37:48 -0500 Received: by mail-pd0-f173.google.com with SMTP id fp1so17598276pdb.4 for ; Tue, 27 Jan 2015 00:37:48 -0800 (PST) X-Received: by 10.66.250.166 with SMTP id zd6mr31489pac.41.1422347868225; Tue, 27 Jan 2015 00:37:48 -0800 (PST) Received: from localhost ([122.178.198.250]) by mx.google.com with ESMTPSA id h6sm845772pdp.15.2015.01.27.00.37.47 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 27 Jan 2015 00:37:47 -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 18/18] cpufreq: Merge __cpufreq_add_dev() and cpufreq_add_dev() Date: Tue, 27 Jan 2015 14:06:24 +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 bcc042a6221a..7501347cf19c 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1148,7 +1148,16 @@ static void cpufreq_policy_free(struct cpufreq_policy *policy, bool notify) kfree(policy); } -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 cpu = dev->id; int ret = -ENOMEM; @@ -1320,20 +1329,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) { @@ -2307,7 +2302,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: @@ -2319,7 +2314,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; } }