summaryrefslogtreecommitdiffstats
path: root/fs/char_dev.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-18 07:05:35 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-25 05:40:31 +0100
commita5815ddf26aa8208d4ad79b4fba5e6bf7d5ba688 (patch)
tree5ad672e3d9f66eeb67b6308704895839b6924b7f /fs/char_dev.c
parentKobject: convert drivers/net/iseries_veth.c to use kobject_init/add_ng() (diff)
downloadlinux-a5815ddf26aa8208d4ad79b4fba5e6bf7d5ba688.tar.xz
linux-a5815ddf26aa8208d4ad79b4fba5e6bf7d5ba688.zip
Kobject: convert fs/char_dev.c to use kobject_init/add_ng()
This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to '')
-rw-r--r--fs/char_dev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index c3bfa76765c4..b2dd5a036631 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -510,9 +510,8 @@ struct cdev *cdev_alloc(void)
{
struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL);
if (p) {
- p->kobj.ktype = &ktype_cdev_dynamic;
INIT_LIST_HEAD(&p->list);
- kobject_init(&p->kobj);
+ kobject_init_ng(&p->kobj, &ktype_cdev_dynamic);
}
return p;
}
@@ -529,8 +528,7 @@ void cdev_init(struct cdev *cdev, const struct file_operations *fops)
{
memset(cdev, 0, sizeof *cdev);
INIT_LIST_HEAD(&cdev->list);
- cdev->kobj.ktype = &ktype_cdev_default;
- kobject_init(&cdev->kobj);
+ kobject_init_ng(&cdev->kobj, &ktype_cdev_default);
cdev->ops = fops;
}