Lines Matching refs:cdev

37 	struct cdev *cdev;		/* will die */  member
247 struct cdev *cdev; in __register_chrdev() local
254 cdev = cdev_alloc(); in __register_chrdev()
255 if (!cdev) in __register_chrdev()
258 cdev->owner = fops->owner; in __register_chrdev()
259 cdev->ops = fops; in __register_chrdev()
260 kobject_set_name(&cdev->kobj, "%s", name); in __register_chrdev()
262 err = cdev_add(cdev, MKDEV(cd->major, baseminor), count); in __register_chrdev()
266 cd->cdev = cdev; in __register_chrdev()
270 kobject_put(&cdev->kobj); in __register_chrdev()
315 if (cd && cd->cdev) in __unregister_chrdev()
316 cdev_del(cd->cdev); in __unregister_chrdev()
322 static struct kobject *cdev_get(struct cdev *p) in cdev_get()
335 void cdev_put(struct cdev *p) in cdev_put()
350 struct cdev *p; in chrdev_open()
351 struct cdev *new = NULL; in chrdev_open()
363 new = container_of(kobj, struct cdev, kobj); in chrdev_open()
408 static void cdev_purge(struct cdev *cdev) in cdev_purge() argument
411 while (!list_empty(&cdev->list)) { in cdev_purge()
413 inode = container_of(cdev->list.next, struct inode, i_devices); in cdev_purge()
432 struct cdev *p = data; in exact_match()
438 struct cdev *p = data; in exact_lock()
452 int cdev_add(struct cdev *p, dev_t dev, unsigned count) in cdev_add()
481 void cdev_del(struct cdev *p) in cdev_del()
490 struct cdev *p = container_of(kobj, struct cdev, kobj); in cdev_default_release()
499 struct cdev *p = container_of(kobj, struct cdev, kobj); in cdev_dynamic_release()
520 struct cdev *cdev_alloc(void) in cdev_alloc()
522 struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); in cdev_alloc()
538 void cdev_init(struct cdev *cdev, const struct file_operations *fops) in cdev_init() argument
540 memset(cdev, 0, sizeof *cdev); in cdev_init()
541 INIT_LIST_HEAD(&cdev->list); in cdev_init()
542 kobject_init(&cdev->kobj, &ktype_cdev_default); in cdev_init()
543 cdev->ops = fops; in cdev_init()