aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@SteelEye.com>2005-08-19 09:14:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-05 19:03:13 -0400
commitd856f1e337782326c638c70c0b4df2b909350dec (patch)
tree15c070e3909cbd260b2616001f0a6dde4a0c24fa /drivers
parentfef6ec8dd96205fb22e3cfe2e4abd69d89413631 (diff)
[PATCH] klist: fix klist to have the same klist_add semantics as list_head
at the moment, the list_head semantics are list_add(node, head) whereas current klist semantics are klist_add(head, node) This is bound to cause confusion, and since klist is the newcomer, it should follow the list_head semantics. I also added missing include guards to klist.h Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/bus.c4
-rw-r--r--drivers/base/core.c2
-rw-r--r--drivers/base/dd.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 6966aff74efe..17e96698410e 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -360,7 +360,7 @@ int bus_add_device(struct device * dev)
360 if (bus) { 360 if (bus) {
361 pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id); 361 pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
362 device_attach(dev); 362 device_attach(dev);
363 klist_add_tail(&bus->klist_devices, &dev->knode_bus); 363 klist_add_tail(&dev->knode_bus, &bus->klist_devices);
364 error = device_add_attrs(bus, dev); 364 error = device_add_attrs(bus, dev);
365 if (!error) { 365 if (!error) {
366 sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id); 366 sysfs_create_link(&bus->devices.kobj, &dev->kobj, dev->bus_id);
@@ -448,7 +448,7 @@ int bus_add_driver(struct device_driver * drv)
448 } 448 }
449 449
450 driver_attach(drv); 450 driver_attach(drv);
451 klist_add_tail(&bus->klist_drivers, &drv->knode_bus); 451 klist_add_tail(&drv->knode_bus, &bus->klist_drivers);
452 module_add_driver(drv->owner, drv); 452 module_add_driver(drv->owner, drv);
453 453
454 driver_add_attrs(bus, drv); 454 driver_add_attrs(bus, drv);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index efe03a024a5b..c8a33df00761 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -249,7 +249,7 @@ int device_add(struct device *dev)
249 if ((error = bus_add_device(dev))) 249 if ((error = bus_add_device(dev)))
250 goto BusError; 250 goto BusError;
251 if (parent) 251 if (parent)
252 klist_add_tail(&parent->klist_children, &dev->knode_parent); 252 klist_add_tail(&dev->knode_parent, &parent->klist_children);
253 253
254 /* notify platform of device entry */ 254 /* notify platform of device entry */
255 if (platform_notify) 255 if (platform_notify)
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 16323f9cbff0..d5bbce38282f 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -42,7 +42,7 @@ void device_bind_driver(struct device * dev)
42{ 42{
43 pr_debug("bound device '%s' to driver '%s'\n", 43 pr_debug("bound device '%s' to driver '%s'\n",
44 dev->bus_id, dev->driver->name); 44 dev->bus_id, dev->driver->name);
45 klist_add_tail(&dev->driver->klist_devices, &dev->knode_driver); 45 klist_add_tail(&dev->knode_driver, &dev->driver->klist_devices);
46 sysfs_create_link(&dev->driver->kobj, &dev->kobj, 46 sysfs_create_link(&dev->driver->kobj, &dev->kobj,
47 kobject_name(&dev->kobj)); 47 kobject_name(&dev->kobj));
48 sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver"); 48 sysfs_create_link(&dev->kobj, &dev->driver->kobj, "driver");