Skip to content

Commit b2d6db5

Browse files
committed
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>
1 parent 9e7bbcc commit b2d6db5

10 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎block/elevator.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ int elv_register_queue(struct request_queue *q)
929929
elevator_t *e = q->elevator;
930930
int error;
931931

932-
error = kobject_add_ng(&e->kobj, &q->kobj, "%s", "iosched");
932+
error = kobject_add(&e->kobj, &q->kobj, "%s", "iosched");
933933
if (!error) {
934934
struct elv_fs_entry *attr = e->elevator_type->elevator_attrs;
935935
if (attr) {

‎block/ll_rw_blk.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,8 +4180,8 @@ int blk_register_queue(struct gendisk *disk)
41804180
if (!q || !q->request_fn)
41814181
return -ENXIO;
41824182

4183-
ret = kobject_add_ng(&q->kobj, kobject_get(&disk->dev.kobj),
4184-
"%s", "queue");
4183+
ret = kobject_add(&q->kobj, kobject_get(&disk->dev.kobj),
4184+
"%s", "queue");
41854185
if (ret < 0)
41864186
return ret;
41874187

‎drivers/base/class.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ int class_device_add(struct class_device *class_dev)
586586
else
587587
class_dev->kobj.parent = &parent_class->subsys.kobj;
588588

589-
error = kobject_add_ng(&class_dev->kobj, class_dev->kobj.parent,
590-
"%s", class_dev->class_id);
589+
error = kobject_add(&class_dev->kobj, class_dev->kobj.parent,
590+
"%s", class_dev->class_id);
591591
if (error)
592592
goto out2;
593593

‎drivers/base/core.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ static struct kobject *get_device_parent(struct device *dev,
602602
if (!k)
603603
return NULL;
604604
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);
606606
if (retval < 0) {
607607
kobject_put(k);
608608
return NULL;
@@ -776,7 +776,7 @@ static void device_remove_class_symlinks(struct device *dev)
776776
* This is part 2 of device_register(), though may be called
777777
* separately _iff_ device_initialize() has been called separately.
778778
*
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
780780
* to the global and sibling lists for the device, then
781781
* adds it to the other relevant subsystems of the driver model.
782782
*/
@@ -807,7 +807,7 @@ int device_add(struct device *dev)
807807
goto Error;
808808

809809
/* 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);
811811
if (error)
812812
goto Error;
813813

‎drivers/base/driver.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
144144
if (!name)
145145
return -ENOMEM;
146146

147-
return kobject_add_ng(kobj, &drv->p->kobj, "%s", name);
147+
return kobject_add(kobj, &drv->p->kobj, "%s", name);
148148
}
149149
EXPORT_SYMBOL_GPL(driver_add_kobj);
150150

‎drivers/md/md.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
13891389
rdev->mddev = mddev;
13901390
printk(KERN_INFO "md: bind<%s>\n", b);
13911391

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)))
13931393
goto fail;
13941394

13951395
if (rdev->bdev->bd_part)

‎drivers/net/iseries_veth.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ static struct net_device * __init veth_probe_one(int vlan,
10841084
}
10851085

10861086
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"))
10881088
veth_error("Failed adding port for %s to sysfs.\n", dev->name);
10891089

10901090
veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n",

‎drivers/uio/uio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
172172
kobject_init_ng(&map->kobj, &map_attr_type);
173173
map->mem = mem;
174174
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);
176176
if (ret)
177177
goto err;
178178
ret = kobject_uevent(&map->kobj, KOBJ_ADD);

‎include/linux/kobject.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ static inline const char * kobject_name(const struct kobject * kobj)
8080

8181
extern void kobject_init(struct kobject *);
8282
extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype);
83-
extern int __must_check kobject_add_ng(struct kobject *kobj,
84-
struct kobject *parent,
85-
const char *fmt, ...);
83+
extern int __must_check kobject_add(struct kobject *kobj,
84+
struct kobject *parent,
85+
const char *fmt, ...);
8686
extern int __must_check kobject_init_and_add(struct kobject *kobj,
8787
struct kobj_type *ktype,
8888
struct kobject *parent,

‎lib/kobject.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
350350
}
351351

352352
/**
353-
* kobject_add_ng - the main kobject add function
353+
* kobject_add - the main kobject add function
354354
* @kobj: the kobject to add
355355
* @parent: pointer to the parent of the kobject.
356356
* @fmt: format to name the kobject with.
@@ -381,8 +381,8 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
381381
* kobject_uevent() with the UEVENT_ADD parameter to ensure that
382382
* userspace is properly notified of this kobject's creation.
383383
*/
384-
int kobject_add_ng(struct kobject *kobj, struct kobject *parent,
385-
const char *fmt, ...)
384+
int kobject_add(struct kobject *kobj, struct kobject *parent,
385+
const char *fmt, ...)
386386
{
387387
va_list args;
388388
int retval;
@@ -396,7 +396,7 @@ int kobject_add_ng(struct kobject *kobj, struct kobject *parent,
396396

397397
return retval;
398398
}
399-
EXPORT_SYMBOL(kobject_add_ng);
399+
EXPORT_SYMBOL(kobject_add);
400400

401401
/**
402402
* kobject_init_and_add - initialize a kobject structure and add it to the kobject hierarchy
@@ -406,8 +406,8 @@ EXPORT_SYMBOL(kobject_add_ng);
406406
* @fmt: the name of the kobject.
407407
*
408408
* This function combines the call to kobject_init_ng() and
409-
* kobject_add_ng(). The same type of error handling after a call to
410-
* kobject_add_ng() and kobject lifetime rules are the same here.
409+
* kobject_add(). The same type of error handling after a call to
410+
* kobject_add() and kobject lifetime rules are the same here.
411411
*/
412412
int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
413413
struct kobject *parent, const char *fmt, ...)
@@ -677,7 +677,7 @@ struct kobject *kobject_create_and_add(const char *name, struct kobject *parent)
677677
if (!kobj)
678678
return NULL;
679679

680-
retval = kobject_add_ng(kobj, parent, "%s", name);
680+
retval = kobject_add(kobj, parent, "%s", name);
681681
if (retval) {
682682
printk(KERN_WARNING "%s: kobject_add error: %d\n",
683683
__FUNCTION__, retval);

0 commit comments

Comments
 (0)