aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-18 06:17:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-09-19 03:20:33 -0400
commit850fdec8d2fd1eebfa003fea39bec08cd69b6155 (patch)
tree6c5412644403983343d17b5729c13afd70bf6016
parent55e001aabb826c96f09e0a440bdcbce620189dbc (diff)
driver core: remove DRIVER_ATTR
DRIVER_ATTR is no longer in use, and driver authors should be using DRIVER_ATTR_RW() or DRIVER_ATTR_RO() or DRIVER_ATTR_WO() instead in order to always get the permissions correct. So remove it so that no one can use it anymore. Acked-by: Alan Tull <atull@kernel.org> Reviewed-by: Moritz Fischer <mdf@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--Documentation/driver-model/driver.txt7
-rw-r--r--Documentation/filesystems/sysfs.txt3
-rw-r--r--include/linux/device.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/Documentation/driver-model/driver.txt b/Documentation/driver-model/driver.txt
index 4421135826a2..d661e6f7e6a0 100644
--- a/Documentation/driver-model/driver.txt
+++ b/Documentation/driver-model/driver.txt
@@ -196,12 +196,13 @@ struct driver_attribute {
196}; 196};
197 197
198Device drivers can export attributes via their sysfs directories. 198Device drivers can export attributes via their sysfs directories.
199Drivers can declare attributes using a DRIVER_ATTR macro that works 199Drivers can declare attributes using a DRIVER_ATTR_RW and DRIVER_ATTR_RO
200identically to the DEVICE_ATTR macro. 200macro that works identically to the DEVICE_ATTR_RW and DEVICE_ATTR_RO
201macros.
201 202
202Example: 203Example:
203 204
204DRIVER_ATTR(debug,0644,show_debug,store_debug); 205DRIVER_ATTR_RW(debug);
205 206
206This is equivalent to declaring: 207This is equivalent to declaring:
207 208
diff --git a/Documentation/filesystems/sysfs.txt b/Documentation/filesystems/sysfs.txt
index 24da7b32c489..9a3658cc399e 100644
--- a/Documentation/filesystems/sysfs.txt
+++ b/Documentation/filesystems/sysfs.txt
@@ -366,7 +366,8 @@ struct driver_attribute {
366 366
367Declaring: 367Declaring:
368 368
369DRIVER_ATTR(_name, _mode, _show, _store) 369DRIVER_ATTR_RO(_name)
370DRIVER_ATTR_RW(_name)
370 371
371Creation/Removal: 372Creation/Removal:
372 373
diff --git a/include/linux/device.h b/include/linux/device.h
index c6f27207dbe8..2bc70ddda09b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -307,8 +307,6 @@ struct driver_attribute {
307 size_t count); 307 size_t count);
308}; 308};
309 309
310#define DRIVER_ATTR(_name, _mode, _show, _store) \
311 struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store)
312#define DRIVER_ATTR_RW(_name) \ 310#define DRIVER_ATTR_RW(_name) \
313 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 311 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
314#define DRIVER_ATTR_RO(_name) \ 312#define DRIVER_ATTR_RO(_name) \