X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fchar_dev.c;h=68e510b88457e85d8831aa0b48a0479c137d3cb3;hb=9d3e19afd35907bf58b205096cd33e97df8fb6a5;hp=c3bfa76765c45c6c516c467663cdb23e6d08907c;hpb=0b776eb5426752d4e53354ac89e3710d857e09a7;p=linux-2.6-omap-h63xx.git diff --git a/fs/char_dev.c b/fs/char_dev.c index c3bfa76765c..68e510b8845 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -55,7 +55,6 @@ static struct char_device_struct { unsigned int baseminor; int minorct; char name[64]; - struct file_operations *fops; struct cdev *cdev; /* will die */ } *chrdevs[CHRDEV_MAJOR_HASH_SIZE]; @@ -357,7 +356,7 @@ void cdev_put(struct cdev *p) /* * Called every time a character special file is opened */ -int chrdev_open(struct inode * inode, struct file * filp) +static int chrdev_open(struct inode *inode, struct file *filp) { struct cdev *p; struct cdev *new = NULL; @@ -510,9 +509,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(&p->kobj, &ktype_cdev_dynamic); } return p; } @@ -529,8 +527,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(&cdev->kobj, &ktype_cdev_default); cdev->ops = fops; }