diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-12 09:33:17 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-08 15:18:52 +0100 |
commit | 2e7189b6c774adc6b848808286b14d0825dc9d1a (patch) | |
tree | 299a2717dabd1b41671f55c9c4790c3125067a0a /drivers/base | |
parent | Linux 5.0-rc1 (diff) | |
download | linux-2e7189b6c774adc6b848808286b14d0825dc9d1a.tar.xz linux-2e7189b6c774adc6b848808286b14d0825dc9d1a.zip |
driver core: bus: convert to use BUS_ATTR_WO and RW
We are trying to get rid of BUS_ATTR() and the usage of that in bus.c
can be trivially converted to use BUS_ATTR_WO and RW, so use those
macros instead.
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/bus.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index e06a57936cc9..a56e865cdbfa 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c @@ -236,12 +236,12 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf, } static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store); -static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf) +static ssize_t drivers_autoprobe_show(struct bus_type *bus, char *buf) { return sprintf(buf, "%d\n", bus->p->drivers_autoprobe); } -static ssize_t store_drivers_autoprobe(struct bus_type *bus, +static ssize_t drivers_autoprobe_store(struct bus_type *bus, const char *buf, size_t count) { if (buf[0] == '0') @@ -251,7 +251,7 @@ static ssize_t store_drivers_autoprobe(struct bus_type *bus, return count; } -static ssize_t store_drivers_probe(struct bus_type *bus, +static ssize_t drivers_probe_store(struct bus_type *bus, const char *buf, size_t count) { struct device *dev; @@ -586,9 +586,8 @@ static void remove_bind_files(struct device_driver *drv) driver_remove_file(drv, &driver_attr_unbind); } -static BUS_ATTR(drivers_probe, S_IWUSR, NULL, store_drivers_probe); -static BUS_ATTR(drivers_autoprobe, S_IWUSR | S_IRUGO, - show_drivers_autoprobe, store_drivers_autoprobe); +static BUS_ATTR_WO(drivers_probe); +static BUS_ATTR_RW(drivers_autoprobe); static int add_probe_files(struct bus_type *bus) { |