aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 18:04:42 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-23 18:04:42 -0400
commit2581c9cc0de6eeba8d5553c98aab6e0f75d184e0 (patch)
treecceb679a2a6685cf48bc84145fd732c4b8736df4 /drivers/base
parent1130c55c757660ac83bd2de220f08580c56b6855 (diff)
driver core: bus: use DRIVER_ATTR_WO()
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>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/bus.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 235e2b06ac05..7fc2a13e84a1 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -165,8 +165,8 @@ static const struct kset_uevent_ops bus_uevent_ops = {
165static struct kset *bus_kset; 165static struct kset *bus_kset;
166 166
167/* Manually detach a device from its associated driver. */ 167/* Manually detach a device from its associated driver. */
168static ssize_t driver_unbind(struct device_driver *drv, 168static ssize_t unbind_store(struct device_driver *drv, const char *buf,
169 const char *buf, size_t count) 169 size_t count)
170{ 170{
171 struct bus_type *bus = bus_get(drv->bus); 171 struct bus_type *bus = bus_get(drv->bus);
172 struct device *dev; 172 struct device *dev;
@@ -185,15 +185,15 @@ static ssize_t driver_unbind(struct device_driver *drv,
185 bus_put(bus); 185 bus_put(bus);
186 return err; 186 return err;
187} 187}
188static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); 188static DRIVER_ATTR_WO(unbind);
189 189
190/* 190/*
191 * Manually attach a device to a driver. 191 * Manually attach a device to a driver.
192 * Note: the driver must want to bind to the device, 192 * Note: the driver must want to bind to the device,
193 * it is not possible to override the driver's id table. 193 * it is not possible to override the driver's id table.
194 */ 194 */
195static ssize_t driver_bind(struct device_driver *drv, 195static ssize_t bind_store(struct device_driver *drv, const char *buf,
196 const char *buf, size_t count) 196 size_t count)
197{ 197{
198 struct bus_type *bus = bus_get(drv->bus); 198 struct bus_type *bus = bus_get(drv->bus);
199 struct device *dev; 199 struct device *dev;
@@ -221,7 +221,7 @@ static ssize_t driver_bind(struct device_driver *drv,
221 bus_put(bus); 221 bus_put(bus);
222 return err; 222 return err;
223} 223}
224static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); 224static DRIVER_ATTR_WO(bind);
225 225
226static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf) 226static ssize_t show_drivers_autoprobe(struct bus_type *bus, char *buf)
227{ 227{
@@ -665,8 +665,8 @@ static void remove_probe_files(struct bus_type *bus)
665 bus_remove_file(bus, &bus_attr_drivers_probe); 665 bus_remove_file(bus, &bus_attr_drivers_probe);
666} 666}
667 667
668static ssize_t driver_uevent_store(struct device_driver *drv, 668static ssize_t uevent_store(struct device_driver *drv, const char *buf,
669 const char *buf, size_t count) 669 size_t count)
670{ 670{
671 enum kobject_action action; 671 enum kobject_action action;
672 672
@@ -674,7 +674,7 @@ static ssize_t driver_uevent_store(struct device_driver *drv,
674 kobject_uevent(&drv->p->kobj, action); 674 kobject_uevent(&drv->p->kobj, action);
675 return count; 675 return count;
676} 676}
677static DRIVER_ATTR(uevent, S_IWUSR, NULL, driver_uevent_store); 677static DRIVER_ATTR_WO(uevent);
678 678
679/** 679/**
680 * bus_add_driver - Add a driver to the bus. 680 * bus_add_driver - Add a driver to the bus.