From patchwork Mon Feb 4 11:38:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2090401 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 82ACCDFE82 for ; Mon, 4 Feb 2013 11:40:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754417Ab3BDLkL (ORCPT ); Mon, 4 Feb 2013 06:40:11 -0500 Received: from mail-da0-f44.google.com ([209.85.210.44]:41605 "EHLO mail-da0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754416Ab3BDLjW (ORCPT ); Mon, 4 Feb 2013 06:39:22 -0500 Received: by mail-da0-f44.google.com with SMTP id z20so2653611dae.17 for ; Mon, 04 Feb 2013 03:39:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references:x-gm-message-state; bh=0GSGjJufiZsenxhPH/mbk6PqnvjYYNt6dLcrYjFW/WY=; b=f7Ie2pmn2EMntPzwwNEu6hHsRQ/X/JSerzlLB+tvyIGSvXXSIuc2UO6nbLfihvIefA iHRAhNj9kdgJz4yMr6laPysgQoitisy90qbEr5CXCkvF7ie0goYWCKbZ6N4q/kdTiAO7 GPTaIBLbdYnbfTwCSijP+PVWinPwH68IlKs73x0vRIIwaMBe90/WqtojXGeKN39ocoOi hQ2qmRNvQ2t7Xj0wCT7n1UC1uoFbVvKgHGWlDrNH1l07tJ2D2J/5f6scOK6kcHkjHtFr eCo+6Vsx9YJUS8JtLIOHcZS7CkJ+qfe41G6H3xNqhkm+WKWEfuwSnBce19dHVkA6eqwi sVgw== X-Received: by 10.66.88.164 with SMTP id bh4mr52134528pab.41.1359977962097; Mon, 04 Feb 2013 03:39:22 -0800 (PST) Received: from localhost ([122.167.114.219]) by mx.google.com with ESMTPS id m3sm20727688pav.4.2013.02.04.03.39.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 04 Feb 2013 03:39:21 -0800 (PST) From: Viresh Kumar To: rjw@sisk.pl Cc: 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, Viresh Kumar Subject: [PATCH 2/4] cpufreq: stats: Get rid of CPUFREQ_STATDEVICE_ATTR Date: Mon, 4 Feb 2013 17:08:52 +0530 Message-Id: <0f3f2223e79388db616fc5925ef8fc6b223f1d81.1359976493.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Gm-Message-State: ALoCoQn7Cx73zwnCxdLMNf1zSZ+GU36XFMA+BnfmSMGyFlpE2ZXELNg12C+gjCF0aDFU1JLkRVFy Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Macro "CPUFREQ_STATDEVICE_ATTR" is defined local to cpufreq_stats.c file and is almost a copy of the generic version present in cpufreq.h file. Lets use the generic version instead. Signed-off-by: Viresh Kumar --- drivers/cpufreq/cpufreq_stats.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index 572124c..a2dee4c 100644 --- a/drivers/cpufreq/cpufreq_stats.c +++ b/drivers/cpufreq/cpufreq_stats.c @@ -24,12 +24,6 @@ static spinlock_t cpufreq_stats_lock; -#define CPUFREQ_STATDEVICE_ATTR(_name, _mode, _show) \ -static struct freq_attr _attr_##_name = {\ - .attr = {.name = __stringify(_name), .mode = _mode, }, \ - .show = _show,\ -}; - struct cpufreq_stats { unsigned int cpu; unsigned int total_trans; @@ -136,17 +130,17 @@ static ssize_t show_trans_table(struct cpufreq_policy *policy, char *buf) return PAGE_SIZE; return len; } -CPUFREQ_STATDEVICE_ATTR(trans_table, 0444, show_trans_table); +cpufreq_freq_attr_ro(trans_table); #endif -CPUFREQ_STATDEVICE_ATTR(total_trans, 0444, show_total_trans); -CPUFREQ_STATDEVICE_ATTR(time_in_state, 0444, show_time_in_state); +cpufreq_freq_attr_ro(total_trans); +cpufreq_freq_attr_ro(time_in_state); static struct attribute *default_attrs[] = { - &_attr_total_trans.attr, - &_attr_time_in_state.attr, + &total_trans.attr, + &time_in_state.attr, #ifdef CONFIG_CPU_FREQ_STAT_DETAILS - &_attr_trans_table.attr, + &trans_table.attr, #endif NULL };