Kobject: rename kobject_init_ng() to kobject_init()

Now that the old kobject_init() function is gone, rename
kobject_init_ng() to kobject_init() to clean up the namespace.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2007-12-17 23:05:35 -07:00
parent e1543ddf73
commit f9cb074bff
10 changed files with 18 additions and 18 deletions

View File

@ -185,7 +185,7 @@ static elevator_t *elevator_alloc(struct request_queue *q,
eq->ops = &e->ops; eq->ops = &e->ops;
eq->elevator_type = e; eq->elevator_type = e;
kobject_init_ng(&eq->kobj, &elv_ktype); kobject_init(&eq->kobj, &elv_ktype);
mutex_init(&eq->sysfs_lock); mutex_init(&eq->sysfs_lock);
eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES, eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES,

View File

@ -1862,7 +1862,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
init_timer(&q->unplug_timer); init_timer(&q->unplug_timer);
kobject_init_ng(&q->kobj, &queue_ktype); kobject_init(&q->kobj, &queue_ktype);
mutex_init(&q->sysfs_lock); mutex_init(&q->sysfs_lock);

View File

@ -553,7 +553,7 @@ static struct class_device_attribute class_uevent_attr =
void class_device_initialize(struct class_device *class_dev) void class_device_initialize(struct class_device *class_dev)
{ {
class_dev->kobj.kset = &class_obj_subsys; class_dev->kobj.kset = &class_obj_subsys;
kobject_init_ng(&class_dev->kobj, &class_device_ktype); kobject_init(&class_dev->kobj, &class_device_ktype);
INIT_LIST_HEAD(&class_dev->node); INIT_LIST_HEAD(&class_dev->node);
} }

View File

@ -525,7 +525,7 @@ static void klist_children_put(struct klist_node *n)
void device_initialize(struct device *dev) void device_initialize(struct device *dev)
{ {
dev->kobj.kset = devices_kset; dev->kobj.kset = devices_kset;
kobject_init_ng(&dev->kobj, &device_ktype); kobject_init(&dev->kobj, &device_ktype);
klist_init(&dev->klist_children, klist_children_get, klist_init(&dev->klist_children, klist_children_get,
klist_children_put); klist_children_put);
INIT_LIST_HEAD(&dev->dma_pools); INIT_LIST_HEAD(&dev->dma_pools);

View File

@ -2033,7 +2033,7 @@ static mdk_rdev_t *md_import_device(dev_t newdev, int super_format, int super_mi
if (err) if (err)
goto abort_free; goto abort_free;
kobject_init_ng(&rdev->kobj, &rdev_ktype); kobject_init(&rdev->kobj, &rdev_ktype);
rdev->desc_nr = -1; rdev->desc_nr = -1;
rdev->saved_raid_disk = -1; rdev->saved_raid_disk = -1;

View File

@ -844,7 +844,7 @@ static int veth_init_connection(u8 rlp)
/* This gets us 1 reference, which is held on behalf of the driver /* This gets us 1 reference, which is held on behalf of the driver
* infrastructure. It's released at module unload. */ * infrastructure. It's released at module unload. */
kobject_init_ng(&cnx->kobject, &veth_lpar_connection_ktype); kobject_init(&cnx->kobject, &veth_lpar_connection_ktype);
msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL); msgs = kcalloc(VETH_NUMBUFFERS, sizeof(struct veth_msg), GFP_KERNEL);
if (! msgs) { if (! msgs) {
@ -1083,7 +1083,7 @@ static struct net_device * __init veth_probe_one(int vlan,
return NULL; return NULL;
} }
kobject_init_ng(&port->kobject, &veth_port_ktype); kobject_init(&port->kobject, &veth_port_ktype);
if (0 != kobject_add(&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);

View File

@ -169,7 +169,7 @@ static int uio_dev_add_attributes(struct uio_device *idev)
map = kzalloc(sizeof(*map), GFP_KERNEL); map = kzalloc(sizeof(*map), GFP_KERNEL);
if (!map) if (!map)
goto err; goto err;
kobject_init_ng(&map->kobj, &map_attr_type); kobject_init(&map->kobj, &map_attr_type);
map->mem = mem; map->mem = mem;
mem->map = map; mem->map = map;
ret = kobject_add(&map->kobj, idev->map_dir, "map%d", mi); ret = kobject_add(&map->kobj, idev->map_dir, "map%d", mi);

View File

@ -511,7 +511,7 @@ struct cdev *cdev_alloc(void)
struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL);
if (p) { if (p) {
INIT_LIST_HEAD(&p->list); INIT_LIST_HEAD(&p->list);
kobject_init_ng(&p->kobj, &ktype_cdev_dynamic); kobject_init(&p->kobj, &ktype_cdev_dynamic);
} }
return p; return p;
} }
@ -528,7 +528,7 @@ void cdev_init(struct cdev *cdev, const struct file_operations *fops)
{ {
memset(cdev, 0, sizeof *cdev); memset(cdev, 0, sizeof *cdev);
INIT_LIST_HEAD(&cdev->list); INIT_LIST_HEAD(&cdev->list);
kobject_init_ng(&cdev->kobj, &ktype_cdev_default); kobject_init(&cdev->kobj, &ktype_cdev_default);
cdev->ops = fops; cdev->ops = fops;
} }

View File

@ -78,7 +78,7 @@ static inline const char * kobject_name(const struct kobject * kobj)
return kobj->k_name; return kobj->k_name;
} }
extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
extern int __must_check kobject_add(struct kobject *kobj, extern int __must_check kobject_add(struct kobject *kobj,
struct kobject *parent, struct kobject *parent,
const char *fmt, ...); const char *fmt, ...);

View File

@ -287,7 +287,7 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...)
EXPORT_SYMBOL(kobject_set_name); EXPORT_SYMBOL(kobject_set_name);
/** /**
* kobject_init_ng - initialize a kobject structure * kobject_init - initialize a kobject structure
* @kobj: pointer to the kobject to initialize * @kobj: pointer to the kobject to initialize
* @ktype: pointer to the ktype for this kobject. * @ktype: pointer to the ktype for this kobject.
* *
@ -298,7 +298,7 @@ EXPORT_SYMBOL(kobject_set_name);
* to kobject_put(), not by a call to kfree directly to ensure that all of * to kobject_put(), not by a call to kfree directly to ensure that all of
* the memory is cleaned up properly. * the memory is cleaned up properly.
*/ */
void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype) void kobject_init(struct kobject *kobj, struct kobj_type *ktype)
{ {
char *err_str; char *err_str;
@ -326,7 +326,7 @@ error:
printk(KERN_ERR "kobject: %s\n", err_str); printk(KERN_ERR "kobject: %s\n", err_str);
dump_stack(); dump_stack();
} }
EXPORT_SYMBOL(kobject_init_ng); EXPORT_SYMBOL(kobject_init);
static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
const char *fmt, va_list vargs) const char *fmt, va_list vargs)
@ -401,7 +401,7 @@ EXPORT_SYMBOL(kobject_add);
* @parent: pointer to the parent of this kobject. * @parent: pointer to the parent of this kobject.
* @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() and
* kobject_add(). The same type of error handling after a call to * kobject_add(). The same type of error handling after a call to
* kobject_add() and kobject lifetime rules are the same here. * kobject_add() and kobject lifetime rules are the same here.
*/ */
@ -411,7 +411,7 @@ int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
va_list args; va_list args;
int retval; int retval;
kobject_init_ng(kobj, ktype); kobject_init(kobj, ktype);
va_start(args, fmt); va_start(args, fmt);
retval = kobject_add_varg(kobj, parent, fmt, args); retval = kobject_add_varg(kobj, parent, fmt, args);
@ -636,7 +636,7 @@ static struct kobj_type dynamic_kobj_ktype = {
* *
* If the kobject was not able to be created, NULL will be returned. * If the kobject was not able to be created, NULL will be returned.
* The kobject structure returned from here must be cleaned up with a * The kobject structure returned from here must be cleaned up with a
* call to kobject_put() and not kfree(), as kobject_init_ng() has * call to kobject_put() and not kfree(), as kobject_init() has
* already been called on this structure. * already been called on this structure.
*/ */
struct kobject *kobject_create(void) struct kobject *kobject_create(void)
@ -647,7 +647,7 @@ struct kobject *kobject_create(void)
if (!kobj) if (!kobj)
return NULL; return NULL;
kobject_init_ng(kobj, &dynamic_kobj_ktype); kobject_init(kobj, &dynamic_kobj_ktype);
return kobj; return kobj;
} }