From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756551AbcKVRbn (ORCPT ); Tue, 22 Nov 2016 12:31:43 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:59054 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755623AbcKVRbl (ORCPT ); Tue, 22 Nov 2016 12:31:41 -0500 Date: Tue, 22 Nov 2016 18:31:49 +0100 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Subject: [PATCH] driver core: add CLASS_ATTR_WO() Message-ID: <20161122173149.GA2841@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some class subsystems are open-coding CLASS_ATTR_WO because the driver core never provided it. Add the macro to device.h so that we can go around and fix up the individual subsystems as needed. Signed-off-by: Greg Kroah-Hartman --- include/linux/device.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/device.h +++ b/include/linux/device.h @@ -465,6 +465,8 @@ struct class_attribute { struct class_attribute class_attr_##_name = __ATTR_RW(_name) #define CLASS_ATTR_RO(_name) \ struct class_attribute class_attr_##_name = __ATTR_RO(_name) +#define CLASS_ATTR_WO(_name) \ + struct class_attribute class_attr_##_name = __ATTR_WO(_name) extern int __must_check class_create_file_ns(struct class *class, const struct class_attribute *attr,