Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 850fdec8 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarAlan Tull <atull@kernel.org>
Reviewed-by: default avatarMoritz Fischer <mdf@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 55e001aa
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -196,12 +196,13 @@ struct driver_attribute {
};

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

Example:

DRIVER_ATTR(debug,0644,show_debug,store_debug);
DRIVER_ATTR_RW(debug);

This is equivalent to declaring:

+2 −1
Original line number Diff line number Diff line
@@ -366,7 +366,8 @@ struct driver_attribute {

Declaring:

DRIVER_ATTR(_name, _mode, _show, _store)
DRIVER_ATTR_RO(_name)
DRIVER_ATTR_RW(_name)

Creation/Removal:

+0 −2
Original line number Diff line number Diff line
@@ -307,8 +307,6 @@ struct driver_attribute {
			 size_t count);
};

#define DRIVER_ATTR(_name, _mode, _show, _store) \
	struct driver_attribute driver_attr_##_name = __ATTR(_name, _mode, _show, _store)
#define DRIVER_ATTR_RW(_name) \
	struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
#define DRIVER_ATTR_RO(_name) \