]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
driver core: bus: use DRIVER_ATTR_WO()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:04:42 +0000 (15:04 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Aug 2013 22:04:42 +0000 (15:04 -0700)
There are two bus attributes that can better be defined using
DRIVER_ATTR_WO(), so convert them to the new macro, making it easier to
audit attribute permissions.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/bus.c

index 235e2b06ac0550df4ee0ae7471ae775151ae43ed..7fc2a13e84a13f8b10b461d6ae34d4d54728a421 100644 (file)
@@ -165,8 +165,8 @@ static const struct kset_uevent_ops bus_uevent_ops = {
 static struct kset *bus_kset;
 
 /* Manually detach a device from its associated driver. */
-static ssize_t driver_unbind(struct device_driver *drv,
-                            const char *buf, size_t count)
+static ssize_t unbind_store(struct device_driver *drv, const char *buf,
+                           size_t count)
 {
        struct bus_type *bus = bus_get(drv->bus);
        struct device *dev;
@@ -185,15 +185,15 @@ static ssize_t driver_unbind(struct device_driver *drv,
        bus_put(bus);
        return err;
 }
-static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);
+static DRIVER_ATTR_WO(unbind);
 
 /*
  * Manually attach a device to a driver.
  * Note: the driver must want to bind to the device,
  * it is not possible to override the driver's id table.
  */
-static ssize_t driver_bind(struct device_driver *drv,
-                          const char *buf, size_t count)
+static ssize_t bind_store(struct device_driver *drv, const char *buf,
+                         size_t count)
 {
        struct bus_type *bus = bus_get(drv->bus);
        struct device *dev;
@@ -221,7 +221,7 @@ static ssize_t driver_bind(struct device_driver *drv,
        bus_put(bus);
        return err;
 }
-static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
+static DRIVER_ATTR_WO(bind);
 
 static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf)
 {
@@ -665,8 +665,8 @@ static void remove_probe_files(struct bus_type *bus)
        bus_remove_file(bus, &bus_attr_drivers_probe);
 }
 
-static ssize_t driver_uevent_store(struct device_driver *drv,
-                                  const char *buf, size_t count)
+static ssize_t uevent_store(struct device_driver *drv, const char *buf,
+                           size_t count)
 {
        enum kobject_action action;
 
@@ -674,7 +674,7 @@ static ssize_t driver_uevent_store(struct device_driver *drv,
                kobject_uevent(&drv->p->kobj, action);
        return count;
 }
-static DRIVER_ATTR(uevent, S_IWUSR, NULL, driver_uevent_store);
+static DRIVER_ATTR_WO(uevent);
 
 /**
  * bus_add_driver - Add a driver to the bus.