blob: f8763615a5f2dc87073cbaa49e64a9e6a1ebe5e4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_CDEV_H
2#define _LINUX_CDEV_H
Linus Torvalds1da177e2005-04-16 15:20:36 -07003
Jan Engelhardt5ec68b22006-12-06 20:36:14 -08004#include <linux/kobject.h>
5#include <linux/kdev_t.h>
6#include <linux/list.h>
7
Jan Engelhardt3d8b3032007-01-29 13:19:56 -08008struct file_operations;
9struct inode;
10struct module;
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012struct cdev {
13 struct kobject kobj;
14 struct module *owner;
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080015 const struct file_operations *ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 struct list_head list;
17 dev_t dev;
18 unsigned int count;
19};
20
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080021void cdev_init(struct cdev *, const struct file_operations *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
23struct cdev *cdev_alloc(void);
24
25void cdev_put(struct cdev *p);
26
27int cdev_add(struct cdev *, dev_t, unsigned);
28
29void cdev_del(struct cdev *);
30
31void cd_forget(struct inode *);
32
Linus Torvalds1da177e2005-04-16 15:20:36 -070033#endif