• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/

Lines Matching refs:cdev

21 #include <linux/cdev.h>
59 struct cdev *cdev; /* will die */
270 struct cdev *cdev;
278 cdev = cdev_alloc();
279 if (!cdev)
282 cdev->owner = fops->owner;
283 cdev->ops = fops;
284 kobject_set_name(&cdev->kobj, "%s", name);
285 for (s = strchr(kobject_name(&cdev->kobj),'/'); s; s = strchr(s, '/'))
288 err = cdev_add(cdev, MKDEV(cd->major, 0), 256);
292 cd->cdev = cdev;
296 kobject_put(&cdev->kobj);
328 if (cd && cd->cdev)
329 cdev_del(cd->cdev);
336 static struct kobject *cdev_get(struct cdev *p)
349 void cdev_put(struct cdev *p)
363 struct cdev *p;
364 struct cdev *new = NULL;
376 new = container_of(kobj, struct cdev, kobj);
415 static void cdev_purge(struct cdev *cdev)
418 while (!list_empty(&cdev->list)) {
420 inode = container_of(cdev->list.next, struct inode, i_devices);
438 struct cdev *p = data;
444 struct cdev *p = data;
450 * @p: the cdev structure for the device
458 int cdev_add(struct cdev *p, dev_t dev, unsigned count)
471 * cdev_del() - remove a cdev from the system
472 * @p: the cdev structure to be removed
477 void cdev_del(struct cdev *p)
486 struct cdev *p = container_of(kobj, struct cdev, kobj);
492 struct cdev *p = container_of(kobj, struct cdev, kobj);
506 * cdev_alloc() - allocate a cdev structure
508 * Allocates and returns a cdev structure, or NULL on failure.
510 struct cdev *cdev_alloc(void)
512 struct cdev *p = kzalloc(sizeof(struct cdev), GFP_KERNEL);
522 * cdev_init() - initialize a cdev structure
523 * @cdev: the structure to initialize
526 * Initializes @cdev, remembering @fops, making it ready to add to the
529 void cdev_init(struct cdev *cdev, const struct file_operations *fops)
531 memset(cdev, 0, sizeof *cdev);
532 INIT_LIST_HEAD(&cdev->list);
533 cdev->kobj.ktype = &ktype_cdev_default;
534 kobject_init(&cdev->kobj);
535 cdev->ops = fops;