Commit b2d6db58 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9e7bbccd
...@@ -929,7 +929,7 @@ int elv_register_queue(struct request_queue *q) ...@@ -929,7 +929,7 @@ int elv_register_queue(struct request_queue *q)
elevator_t *e = q->elevator; elevator_t *e = q->elevator;
int error; int error;
error = kobject_add_ng(&e->kobj, &q->kobj, "%s", "iosched"); error = kobject_add(&e->kobj, &q->kobj, "%s", "iosched");
if (!error) { if (!error) {
struct elv_fs_entry *attr = e->elevator_type->elevator_attrs; struct elv_fs_entry *attr = e->elevator_type->elevator_attrs;
if (attr) { if (attr) {
......
...@@ -4180,7 +4180,7 @@ int blk_register_queue(struct gendisk *disk) ...@@ -4180,7 +4180,7 @@ int blk_register_queue(struct gendisk *disk)
if (!q || !q->request_fn) if (!q || !q->request_fn)
return -ENXIO; return -ENXIO;
ret = kobject_add_ng(&q->kobj, kobject_get(&disk->dev.kobj), ret = kobject_add(&q->kobj, kobject_get(&disk->dev.kobj),
"%s", "queue"); "%s", "queue");
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -586,7 +586,7 @@ int class_device_add(struct class_device *class_dev) ...@@ -586,7 +586,7 @@ int class_device_add(struct class_device *class_dev)
else else
class_dev->kobj.parent = &parent_class->subsys.kobj; class_dev->kobj.parent = &parent_class->subsys.kobj;
error = kobject_add_ng(&class_dev->kobj, class_dev->kobj.parent, error = kobject_add(&class_dev->kobj, class_dev->kobj.parent,
"%s", class_dev->class_id); "%s", class_dev->class_id);
if (error) if (error)
goto out2; goto out2;
......
...@@ -602,7 +602,7 @@ static struct kobject *get_device_parent(struct device *dev, ...@@ -602,7 +602,7 @@ static struct kobject *get_device_parent(struct device *dev,
if (!k) if (!k)
return NULL; return NULL;
k->kset = &dev->class->class_dirs; k->kset = &dev->class->class_dirs;
retval = kobject_add_ng(k, parent_kobj, "%s", dev->class->name); retval = kobject_add(k, parent_kobj, "%s", dev->class->name);
if (retval < 0) { if (retval < 0) {
kobject_put(k); kobject_put(k);
return NULL; return NULL;
...@@ -776,7 +776,7 @@ static void device_remove_class_symlinks(struct device *dev) ...@@ -776,7 +776,7 @@ static void device_remove_class_symlinks(struct device *dev)
* This is part 2 of device_register(), though may be called * This is part 2 of device_register(), though may be called
* separately _iff_ device_initialize() has been called separately. * separately _iff_ device_initialize() has been called separately.
* *
* This adds it to the kobject hierarchy via kobject_add_ng(), adds it * This adds it to the kobject hierarchy via kobject_add(), adds it
* to the global and sibling lists for the device, then * to the global and sibling lists for the device, then
* adds it to the other relevant subsystems of the driver model. * adds it to the other relevant subsystems of the driver model.
*/ */
...@@ -807,7 +807,7 @@ int device_add(struct device *dev) ...@@ -807,7 +807,7 @@ int device_add(struct device *dev)
goto Error; goto Error;
/* first, register with generic layer. */ /* first, register with generic layer. */
error = kobject_add_ng(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id); error = kobject_add(&dev->kobj, dev->kobj.parent, "%s", dev->bus_id);
if (error) if (error)
goto Error; goto Error;
......
...@@ -144,7 +144,7 @@ int driver_add_kobj(struct device_driver *drv, struct kobject *kobj, ...@@ -144,7 +144,7 @@ int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
if (!name) if (!name)
return -ENOMEM; return -ENOMEM;
return kobject_add_ng(kobj, &drv->p->kobj, "%s", name); return kobject_add(kobj, &drv->p->kobj, "%s", name);
} }
EXPORT_SYMBOL_GPL(driver_add_kobj); EXPORT_SYMBOL_GPL(driver_add_kobj);
......
...@@ -1389,7 +1389,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev) ...@@ -1389,7 +1389,7 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
rdev->mddev = mddev; rdev->mddev = mddev;
printk(KERN_INFO "md: bind<%s>\n", b); printk(KERN_INFO "md: bind<%s>\n", b);
if ((err = kobject_add_ng(&rdev->kobj, &mddev->kobj, "dev-%s", b))) if ((err = kobject_add(&rdev->kobj, &mddev->kobj, "dev-%s", b)))
goto fail; goto fail;
if (rdev->bdev->bd_part) if (rdev->bdev->bd_part)
......
...@@ -1084,7 +1084,7 @@ static struct net_device * __init veth_probe_one(int vlan, ...@@ -1084,7 +1084,7 @@ static struct net_device * __init veth_probe_one(int vlan,
} }
kobject_init_ng(&port->kobject, &veth_port_ktype); kobject_init_ng(&port->kobject, &veth_port_ktype);
if (0 != kobject_add_ng(&port->kobject, &dev->dev.kobj, "veth_port")) if (0 != kobject_add(&port->kobject, &dev->dev.kobj, "veth_port"))
veth_error("Failed adding port for %s to sysfs.\n", dev->name); veth_error("Failed adding port for %s to sysfs.\n", dev->name);
veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n", veth_info("%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n",
......
...@@ -172,7 +172,7 @@ static int uio_dev_add_attributes(struct uio_device *idev) ...@@ -172,7 +172,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
kobject_init_ng(&map->kobj, &map_attr_type); kobject_init_ng(&map->kobj, &map_attr_type);
map->mem = mem; map->mem = mem;
mem->map = map; mem->map = map;
ret = kobject_add_ng(&map->kobj, idev->map_dir, "map%d", mi); ret = kobject_add(&map->kobj, idev->map_dir, "map%d", mi);
if (ret) if (ret)
goto err; goto err;
ret = kobject_uevent(&map->kobj, KOBJ_ADD); ret = kobject_uevent(&map->kobj, KOBJ_ADD);
......
...@@ -80,7 +80,7 @@ static inline const char * kobject_name(const struct kobject * kobj) ...@@ -80,7 +80,7 @@ static inline const char * kobject_name(const struct kobject * kobj)
extern void kobject_init(struct kobject *); extern void kobject_init(struct kobject *);
extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype);
extern int __must_check kobject_add_ng(struct kobject *kobj, extern int __must_check kobject_add(struct kobject *kobj,
struct kobject *parent, struct kobject *parent,
const char *fmt, ...); const char *fmt, ...);
extern int __must_check kobject_init_and_add(struct kobject *kobj, extern int __must_check kobject_init_and_add(struct kobject *kobj,
......
...@@ -350,7 +350,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, ...@@ -350,7 +350,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
} }
/** /**
* kobject_add_ng - the main kobject add function * kobject_add - the main kobject add function
* @kobj: the kobject to add * @kobj: the kobject to add
* @parent: pointer to the parent of the kobject. * @parent: pointer to the parent of the kobject.
* @fmt: format to name the kobject with. * @fmt: format to name the kobject with.
...@@ -381,7 +381,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, ...@@ -381,7 +381,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
* kobject_uevent() with the UEVENT_ADD parameter to ensure that * kobject_uevent() with the UEVENT_ADD parameter to ensure that
* userspace is properly notified of this kobject's creation. * userspace is properly notified of this kobject's creation.
*/ */
int kobject_add_ng(struct kobject *kobj, struct kobject *parent, int kobject_add(struct kobject *kobj, struct kobject *parent,
const char *fmt, ...) const char *fmt, ...)
{ {
va_list args; va_list args;
...@@ -396,7 +396,7 @@ int kobject_add_ng(struct kobject *kobj, struct kobject *parent, ...@@ -396,7 +396,7 @@ int kobject_add_ng(struct kobject *kobj, struct kobject *parent,
return retval; return retval;
} }
EXPORT_SYMBOL(kobject_add_ng); EXPORT_SYMBOL(kobject_add);
/** /**
* kobject_init_and_add - initialize a kobject structure and add it to the kobject hierarchy * 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,8 +406,8 @@ EXPORT_SYMBOL(kobject_add_ng);
* @fmt: the name of the kobject. * @fmt: the name of the kobject.
* *
* This function combines the call to kobject_init_ng() and * This function combines the call to kobject_init_ng() and
* kobject_add_ng(). The same type of error handling after a call to * kobject_add(). The same type of error handling after a call to
* kobject_add_ng() and kobject lifetime rules are the same here. * kobject_add() and kobject lifetime rules are the same here.
*/ */
int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype, int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
struct kobject *parent, const char *fmt, ...) struct kobject *parent, const char *fmt, ...)
...@@ -677,7 +677,7 @@ struct kobject *kobject_create_and_add(const char *name, struct kobject *parent) ...@@ -677,7 +677,7 @@ struct kobject *kobject_create_and_add(const char *name, struct kobject *parent)
if (!kobj) if (!kobj)
return NULL; return NULL;
retval = kobject_add_ng(kobj, parent, "%s", name); retval = kobject_add(kobj, parent, "%s", name);
if (retval) { if (retval) {
printk(KERN_WARNING "%s: kobject_add error: %d\n", printk(KERN_WARNING "%s: kobject_add error: %d\n",
__FUNCTION__, retval); __FUNCTION__, retval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment