diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-18 01:05:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:31 -0500 |
commit | a5815ddf26aa8208d4ad79b4fba5e6bf7d5ba688 (patch) | |
tree | 5ad672e3d9f66eeb67b6308704895839b6924b7f | |
parent | 78be3d2f574bf8a9886550ad07b8124b194badb8 (diff) |
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>
-rw-r--r-- | fs/char_dev.c | 6 |
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) | |||
510 | { | 510 | { |
511 | struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); | 511 | struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); |
512 | if (p) { | 512 | if (p) { |
513 | p->kobj.ktype = &ktype_cdev_dynamic; | ||
514 | INIT_LIST_HEAD(&p->list); | 513 | INIT_LIST_HEAD(&p->list); |
515 | kobject_init(&p->kobj); | 514 | kobject_init_ng(&p->kobj, &ktype_cdev_dynamic); |
516 | } | 515 | } |
517 | return p; | 516 | return p; |
518 | } | 517 | } |
@@ -529,8 +528,7 @@ void cdev_init(struct cdev *cdev, const struct file_operations *fops) | |||
529 | { | 528 | { |
530 | memset(cdev, 0, sizeof *cdev); | 529 | memset(cdev, 0, sizeof *cdev); |
531 | INIT_LIST_HEAD(&cdev->list); | 530 | INIT_LIST_HEAD(&cdev->list); |
532 | cdev->kobj.ktype = &ktype_cdev_default; | 531 | kobject_init_ng(&cdev->kobj, &ktype_cdev_default); |
533 | kobject_init(&cdev->kobj); | ||
534 | cdev->ops = fops; | 532 | cdev->ops = fops; |
535 | } | 533 | } |
536 | 534 | ||