Skip to content

Commit 850fdec

Browse files
committed
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>
1 parent 55e001a commit 850fdec

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Documentation/driver-model/driver.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ struct driver_attribute {
196196
};
197197

198198
Device drivers can export attributes via their sysfs directories.
199-
Drivers can declare attributes using a DRIVER_ATTR macro that works
200-
identically to the DEVICE_ATTR macro.
199+
Drivers can declare attributes using a DRIVER_ATTR_RW and DRIVER_ATTR_RO
200+
macro that works identically to the DEVICE_ATTR_RW and DEVICE_ATTR_RO
201+
macros.
201202

202203
Example:
203204

204-
DRIVER_ATTR(debug,0644,show_debug,store_debug);
205+
DRIVER_ATTR_RW(debug);
205206

206207
This is equivalent to declaring:
207208

Documentation/filesystems/sysfs.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ struct driver_attribute {
366366

367367
Declaring:
368368

369-
DRIVER_ATTR(_name, _mode, _show, _store)
369+
DRIVER_ATTR_RO(_name)
370+
DRIVER_ATTR_RW(_name)
370371

371372
Creation/Removal:
372373

include/linux/device.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,6 @@ struct driver_attribute {
307307
size_t count);
308308
};
309309

310-
#define DRIVER_ATTR(_name, _mode, _show, _store) \
311-
struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store)
312310
#define DRIVER_ATTR_RW(_name) \
313311
struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
314312
#define DRIVER_ATTR_RO(_name) \

0 commit comments

Comments
 (0)