aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-18 01:05:35 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:38 -0500
commitb2d6db5878a0832659ed58476357eea2db915550 (patch)
treec7c9e98431078ca7b0405e8003bd905ab62df7c4
parent9e7bbccd0290e720e0874443932869c55f63d5a8 (diff)
Kobject: rename kobject_add_ng() to kobject_add()
Now that the old kobject_add() function is gone, rename kobject_add_ng() to kobject_add() to clean up the namespace. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--block/elevator.c2
-rw-r--r--block/ll_rw_blk.c4
-rw-r--r--drivers/base/class.c4
-rw-r--r--drivers/base/core.c6
-rw-r--r--drivers/base/driver.c2
-rw-r--r--drivers/md/md.c2
-rw-r--r--drivers/net/iseries_veth.c2
-rw-r--r--drivers/uio/uio.c2
-rw-r--r--include/linux/kobject.h6
-rw-r--r--lib/kobject.c14
10 files changed, 22 insertions, 22 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 5445c3c2ee8a..645469a4f49f 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -929,7 +929,7 @@ int elv_register_queue(struct request_queue *q)
929 elevator_t *e = q->elevator; 929 elevator_t *e = q->elevator;
930 int error; 930 int error;
931 931
932 error = kobject_add_ng(&e->kobj, &q->kobj, "%s", "iosched"); 932 error = kobject_add(&e->kobj, &q->kobj, "%s", "iosched");
933 if (!error) { 933 if (!error) {
934 struct elv_fs_entry *attr = e->elevator_type->elevator_attrs; 934 struct elv_fs_entry *attr = e->elevator_type->elevator_attrs;
935 if (attr) { 935 if (attr) {
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 8054b7d8e07c..234dd3de1824 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -4180,8 +4180,8 @@ int blk_register_queue(struct gendisk *disk)
4180 if (!q || !q->request_fn) 4180 if (!q || !q->request_fn)
4181 return -ENXIO; 4181 return -ENXIO;
4182 4182
4183 ret = kobject_add_ng(&q->kobj, kobject_get(&disk->dev.kobj), 4183 ret = kobject_add(&q->kobj, kobject_get(&disk->dev.kobj),
4184 "%s", "queue"); 4184 "%s", "queue");
4185 if (ret < 0) 4185 if (ret < 0)
4186 return ret; 4186 return ret;
4187 4187
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 624b3316e938..8e3cba224384 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -586,8 +586,8 @@ int class_device_add(struct class_device *class_dev)
586 else 586 else
587 class_dev->kobj.parent = &parent_class->subsys.kobj; 587 class_dev->kobj.parent = &parent_class->subsys.kobj;
588 588
589 error = kobject_add_ng(&class_dev->kobj, class_dev->kobj.parent, 589 error = kobject_add(&class_dev->kobj, class_dev->kobj.parent,
590 "%s", class_dev->class_id); 590 "%s", class_dev->class_id);
591 if (error) 591 if (error)
592 goto out2; 592 goto out2;
593 593
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 06e8738ab263..e88170293ca0 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -602,7 +602,7 @@ static struct kobject *get_device_parent(struct device *dev,
602 if (!k) 602 if (!k)
603 return NULL; 603 return NULL;
604 k->kset = &dev->class->class_dirs; 604 k->kset = &dev->class->class_dirs;
605 retval = kobject_add_ng(k, parent_kobj, "%s", dev->class->name); 605 retval = kobject_add(k, parent_kobj, "%s", dev->class->name);
606 if (retval < 0) { 606 if (retval < 0) {
607 kobject_put(k); 607 kobject_put(k);
608 return NULL; 608 return NULL;
@@ -776,7 +776,7 @@ static void device_remove_class_symlinks(struct device *dev)
776 * This is part 2 of device_register(), though may be called 776 * This is part 2 of device_register(), though may be called
777 * separately _iff_ device_initialize() has been called separately. 777 * separately _iff_ device_initialize() has been called separately.
778 * 778 *
779 * This adds it to the kobject hierarchy via kobject_add_ng(), adds it 779 * This adds it to the kobject hierarchy via kobject_add(), adds it
780 * to the global and sibling lists for the device, then 780 * to the global and sibling lists for the device, then
781 * adds it to the other relevant subsystems of the driver model. 781 * adds it to the other relevant subsystems of the driver model.
782 */ 782 */
@@ -807,7 +807,7 @@ int device_add(struct device *dev)
807 goto Error; 807 goto Error;
808 808
809 /* first, register with generic layer. */ 809 /* first, register with generic layer. */
810 error = kobject_add_ng(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id); 810 error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
811 if (error) 811 if (error)
812 goto Error; 812 goto Error;
813 813
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 5aacff208f21..94b697a9b4e0 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -144,7 +144,7 @@ int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
144 if (!name) 144 if (!name)
145 return -ENOMEM; 145 return -ENOMEM;
146 146
147 return kobject_add_ng(kobj, &drv->p->kobj, "%s", name); 147 return kobject_add(kobj, &drv->p->kobj, "%s", name);
148} 148}
149EXPORT_SYMBOL_GPL(driver_add_kobj); 149EXPORT_SYMBOL_GPL(driver_add_kobj);
150 150
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 7ae9740c483d..989d8549f988 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1389,7 +1389,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1389 rdev->mddev = mddev; 1389 rdev->mddev = mddev;
1390 printk(KERN_INFO "md: bind<%s>\n", b); 1390 printk(KERN_INFO "md: bind<%s>\n", b);
1391 1391
1392 if ((err = kobject_add_ng(&rdev->kobj, &mddev->kobj, "dev-%s", b))) 1392 if ((err = kobject_add(&rdev->kobj, &mddev->kobj, "dev-%s", b)))
1393 goto fail; 1393 goto fail;
1394 1394
1395 if (rdev->bdev->bd_part) 1395 if (rdev->bdev->bd_part)
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 1a8299acd3f1..ee15667d6135 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -1084,7 +1084,7 @@ static struct net_device * __init veth_probe_one(int vlan,
1084 } 1084 }
1085 1085
1086 kobject_init_ng(&port->kobject, &veth_port_ktype); 1086 kobject_init_ng(&port->kobject, &veth_port_ktype);
1087 if (0 != kobject_add_ng(&port->kobject, &dev->dev.kobj, "veth_port")) 1087 if (0 != kobject_add(&port->kobject, &dev->dev.kobj, "veth_port"))
1088 veth_error("Failed adding port for %s to sysfs.\n", dev->name); 1088 veth_error("Failed adding port for %s to sysfs.\n", dev->name);
1089 1089
1090 veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n", 1090 veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n",
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index acc387de988f..1ec2d31f2639 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -172,7 +172,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
172 kobject_init_ng(&map->kobj, &map_attr_type); 172 kobject_init_ng(&map->kobj, &map_attr_type);
173 map->mem = mem; 173 map->mem = mem;
174 mem->map = map; 174 mem->map = map;
175 ret = kobject_add_ng(&map->kobj, idev->map_dir, "map%d", mi); 175 ret = kobject_add(&map->kobj, idev->map_dir, "map%d", mi);
176 if (ret) 176 if (ret)
177 goto err; 177 goto err;
178 ret = kobject_uevent(&map->kobj, KOBJ_ADD); 178 ret = kobject_uevent(&map->kobj, KOBJ_ADD);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 8b0aa715fa2f..84c5afd58899 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -80,9 +80,9 @@ static inline const char * kobject_name(const struct kobject * kobj)
80 80
81extern void kobject_init(struct kobject *); 81extern void kobject_init(struct kobject *);
82extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); 82extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype);
83extern int __must_check kobject_add_ng(struct kobject *kobj, 83extern int __must_check kobject_add(struct kobject *kobj,
84 struct kobject *parent, 84 struct kobject *parent,
85 const char *fmt, ...); 85 const char *fmt, ...);
86extern int __must_check kobject_init_and_add(struct kobject *kobj, 86extern int __must_check kobject_init_and_add(struct kobject *kobj,
87 struct kobj_type *ktype, 87 struct kobj_type *ktype,
88 struct kobject *parent, 88 struct kobject *parent,
diff --git a/lib/kobject.c b/lib/kobject.c
index d04789fa4da9..359e114790cb 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -350,7 +350,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
350} 350}
351 351
352/** 352/**
353 * kobject_add_ng - the main kobject add function 353 * kobject_add - the main kobject add function
354 * @kobj: the kobject to add 354 * @kobj: the kobject to add
355 * @parent: pointer to the parent of the kobject. 355 * @parent: pointer to the parent of the kobject.
356 * @fmt: format to name the kobject with. 356 * @fmt: format to name the kobject with.
@@ -381,8 +381,8 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
381 * kobject_uevent() with the UEVENT_ADD parameter to ensure that 381 * kobject_uevent() with the UEVENT_ADD parameter to ensure that
382 * userspace is properly notified of this kobject's creation. 382 * userspace is properly notified of this kobject's creation.
383 */ 383 */
384int kobject_add_ng(struct kobject *kobj, struct kobject *parent, 384int kobject_add(struct kobject *kobj, struct kobject *parent,
385 const char *fmt, ...) 385 const char *fmt, ...)
386{ 386{
387 va_list args; 387 va_list args;
388 int retval; 388 int retval;
@@ -396,7 +396,7 @@ int kobject_add_ng(struct kobject *kobj, struct kobject *parent,
396 396
397 return retval; 397 return retval;
398} 398}
399EXPORT_SYMBOL(kobject_add_ng); 399EXPORT_SYMBOL(kobject_add);
400 400
401/** 401/**
402 * kobject_init_and_add - initialize a kobject structure and add it to the kobject hierarchy 402 * kobject_init_and_add - initialize a kobject structure and add it to the kobject hierarchy
@@ -406,8 +406,8 @@ EXPORT_SYMBOL(kobject_add_ng);
406 * @fmt: the name of the kobject. 406 * @fmt: the name of the kobject.
407 * 407 *
408 * This function combines the call to kobject_init_ng() and 408 * This function combines the call to kobject_init_ng() and
409 * kobject_add_ng(). The same type of error handling after a call to 409 * kobject_add(). The same type of error handling after a call to
410 * kobject_add_ng() and kobject lifetime rules are the same here. 410 * kobject_add() and kobject lifetime rules are the same here.
411 */ 411 */
412int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype, 412int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
413 struct kobject *parent, const char *fmt, ...) 413 struct kobject *parent, const char *fmt, ...)
@@ -677,7 +677,7 @@ struct kobject *kobject_create_and_add(const char *name, struct kobject *parent)
677 if (!kobj) 677 if (!kobj)
678 return NULL; 678 return NULL;
679 679
680 retval = kobject_add_ng(kobj, parent, "%s", name); 680 retval = kobject_add(kobj, parent, "%s", name);
681 if (retval) { 681 if (retval) {
682 printk(KERN_WARNING "%s: kobject_add error: %d\n", 682 printk(KERN_WARNING "%s: kobject_add error: %d\n",
683 __FUNCTION__, retval); 683 __FUNCTION__, retval);