From patchwork Fri Nov 4 16:55:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Mayer X-Patchwork-Id: 9412911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 22AA36022E for ; Fri, 4 Nov 2016 16:56:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13CDD2AC8C for ; Fri, 4 Nov 2016 16:56:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 083FA2AF69; Fri, 4 Nov 2016 16:56:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 965272AC8C for ; Fri, 4 Nov 2016 16:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965089AbcKDQ4I (ORCPT ); Fri, 4 Nov 2016 12:56:08 -0400 Received: from smtp-out-no.shaw.ca ([64.59.134.13]:51418 "EHLO smtp-out-no.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932283AbcKDQ4H (ORCPT ); Fri, 4 Nov 2016 12:56:07 -0400 Received: from triton.mmayer.net ([70.71.160.251]) by shaw.ca with SMTP id 2hmfcnh80c4x72hmgcCrvG; Fri, 04 Nov 2016 10:56:06 -0600 X-Authority-Analysis: v=2.2 cv=WohbCZXv c=1 sm=1 tr=0 a=6xzog4CasRozao6qlzTIAw==:117 a=6xzog4CasRozao6qlzTIAw==:17 a=L24OOQBejmoA:10 a=Q-fNiiVtAAAA:8 a=DLcbzthlkqUAh64zG-QA:9 a=0bXxn9q0MV6snEgNplNhOjQmxlI=:19 a=Fp8MccfUoT0GBdDC_Lng:22 Received: by triton.mmayer.net (Postfix, from userid 501) id 415902AE4AB5; Fri, 4 Nov 2016 09:56:05 -0700 (PDT) From: Markus Mayer To: Viresh Kumar , "Rafael J . Wysocki" Cc: Power Management List , Broadcom Kernel List , Linux Kernel Mailing List , Markus Mayer Subject: [PATCH v2 1/2] cpufreq: add new attribute type cpufreq_freq_attr_wr_perm() Date: Fri, 4 Nov 2016 09:55:35 -0700 Message-Id: <20161104165536.20088-2-code@mmayer.net> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20161104165536.20088-1-code@mmayer.net> References: <20161104165536.20088-1-code@mmayer.net> X-CMAE-Envelope: MS4wfFnzOFCSxhOfhBe4K8duTdYY23sfaKircGaRsoisqLvN5yi8nSAl2wHSQBP3KOfn/IFoGanigpKyIv3Jv7/S0qw3cHuGNPG4WRvW+qEwCwjPJYIOshRr EhHLKe9iCRIRDvHdXsWwdkyA5+xjv8hLcC4lI2033vZrWut058s0PaH+swDybs475bszYSfEAxhyAfaHmXLuNbWpeXIz5B6u1a1qIpVqWBNFFM8HzvkqLwxt odgQNUq8EVR4LpxeEtlBVbUa/4LymYle0dhxfekk4MIvYrWfrdJ1BCVwqHBDTRtiUPyfYuyUCmW7DFxQJdNdZqe9mxXU2uCTVRfbJ+3UfUx0dygMGnaIzODv fuTb9Vlpi6GViTKVBZ8B2sQ+jUaltQ== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Mayer With the new attribute type, it is possible to create write-only CPUfreq attributes. Signed-off-by: Markus Mayer --- include/linux/cpufreq.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 5fa55fc..ed09930 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -234,6 +234,10 @@ __ATTR(_name, _perm, show_##_name, NULL) static struct freq_attr _name = \ __ATTR(_name, 0644, show_##_name, store_##_name) +#define cpufreq_freq_attr_wr_perm(_name, _perm) \ +static struct freq_attr _name = \ +__ATTR(_name, _perm, NULL, store_##_name) + struct global_attr { struct attribute attr; ssize_t (*show)(struct kobject *kobj,