From 2027cbcf497579cb3bd71ed4173ae9b950aa09a3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 22 Nov 2016 18:31:49 +0100 Subject: [PATCH] driver core: add CLASS_ATTR_WO() 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(+) diff --git a/include/linux/device.h b/include/linux/device.h index 49f453892ca5..4264caacebb9 100644 --- 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, -- 2.20.1