Lines Matching refs:cdev
40 struct cdev *cdev; /* will die */ member
273 struct cdev *cdev; in __register_chrdev() local
280 cdev = cdev_alloc(); in __register_chrdev()
281 if (!cdev) in __register_chrdev()
284 cdev->owner = fops->owner; in __register_chrdev()
285 cdev->ops = fops; in __register_chrdev()
286 kobject_set_name(&cdev->kobj, "%s", name); in __register_chrdev()
288 err = cdev_add(cdev, MKDEV(cd->major, baseminor), count); in __register_chrdev()
292 cd->cdev = cdev; in __register_chrdev()
296 kobject_put(&cdev->kobj); in __register_chrdev()
341 if (cd && cd->cdev) in __unregister_chrdev()
342 cdev_del(cd->cdev); in __unregister_chrdev()
348 static struct kobject *cdev_get(struct cdev *p) in cdev_get()
361 void cdev_put(struct cdev *p) in cdev_put()
376 struct cdev *p; in chrdev_open()
377 struct cdev *new = NULL; in chrdev_open()
389 new = container_of(kobj, struct cdev, kobj); in chrdev_open()
435 static void cdev_purge(struct cdev *cdev) in cdev_purge() argument
438 while (!list_empty(&cdev->list)) { in cdev_purge()
440 inode = container_of(cdev->list.next, struct inode, i_devices); in cdev_purge()
459 struct cdev *p = data; in exact_match()
465 struct cdev *p = data; in exact_lock()
479 int cdev_add(struct cdev *p, dev_t dev, unsigned count) in cdev_add()
505 void cdev_set_parent(struct cdev *p, struct kobject *kobj) in cdev_set_parent()
534 int cdev_device_add(struct cdev *cdev, struct device *dev) in cdev_device_add() argument
539 cdev_set_parent(cdev, &dev->kobj); in cdev_device_add()
541 rc = cdev_add(cdev, dev->devt, 1); in cdev_device_add()
548 cdev_del(cdev); in cdev_device_add()
568 void cdev_device_del(struct cdev *cdev, struct device *dev) in cdev_device_del() argument
572 cdev_del(cdev); in cdev_device_del()
591 void cdev_del(struct cdev *p) in cdev_del()
600 struct cdev *p = container_of(kobj, struct cdev, kobj); in cdev_default_release()
609 struct cdev *p = container_of(kobj, struct cdev, kobj); in cdev_dynamic_release()
630 struct cdev *cdev_alloc(void) in cdev_alloc()
632 struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL); in cdev_alloc()
648 void cdev_init(struct cdev *cdev, const struct file_operations *fops) in cdev_init() argument
650 memset(cdev, 0, sizeof *cdev); in cdev_init()
651 INIT_LIST_HEAD(&cdev->list); in cdev_init()
652 kobject_init(&cdev->kobj, &ktype_cdev_default); in cdev_init()
653 cdev->ops = fops; in cdev_init()