소스 검색

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 <gregkh@linuxfoundation.org>
Greg Kroah-Hartman 8 년 전
부모
커밋
2027cbcf49
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      include/linux/device.h

+ 2 - 0
include/linux/device.h

@@ -465,6 +465,8 @@ struct class_attribute {
 	struct class_attribute class_attr_##_name = __ATTR_RW(_name)
 	struct class_attribute class_attr_##_name = __ATTR_RW(_name)
 #define CLASS_ATTR_RO(_name) \
 #define CLASS_ATTR_RO(_name) \
 	struct class_attribute class_attr_##_name = __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,
 extern int __must_check class_create_file_ns(struct class *class,
 					     const struct class_attribute *attr,
 					     const struct class_attribute *attr,