浏览代码

driver core: add BUS_ATTR_WO() macro

Many bus attributes are write-only, so provide a simple macro for that
to be able to match the other driver core attribute macros.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Greg Kroah-Hartman 7 年之前
父节点
当前提交
8514c470dc
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      include/linux/device.h

+ 2 - 0
include/linux/device.h

@@ -55,6 +55,8 @@ struct bus_attribute {
 	struct bus_attribute bus_attr_##_name = __ATTR_RW(_name)
 	struct bus_attribute bus_attr_##_name = __ATTR_RW(_name)
 #define BUS_ATTR_RO(_name) \
 #define BUS_ATTR_RO(_name) \
 	struct bus_attribute bus_attr_##_name = __ATTR_RO(_name)
 	struct bus_attribute bus_attr_##_name = __ATTR_RO(_name)
+#define BUS_ATTR_WO(_name) \
+	struct bus_attribute bus_attr_##_name = __ATTR_WO(_name)
 
 
 extern int __must_check bus_create_file(struct bus_type *,
 extern int __must_check bus_create_file(struct bus_type *,
 					struct bus_attribute *);
 					struct bus_attribute *);