summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/cdev.h30
-rw-r--r--include/linux/fs.h6
-rw-r--r--include/linux/tty_driver.h2
3 files changed, 34 insertions, 4 deletions
diff --git a/include/linux/cdev.h b/include/linux/cdev.h
new file mode 100644
index 000000000000..faa67d2f4323
--- /dev/null
+++ b/include/linux/cdev.h
@@ -0,0 +1,30 @@
+#ifndef _LINUX_CDEV_H
+#define _LINUX_CDEV_H
+#ifdef __KERNEL__
+
+struct cdev {
+ struct kobject kobj;
+ struct module *owner;
+ struct file_operations *ops;
+};
+
+void cdev_init(struct cdev *, struct file_operations *);
+
+struct cdev *cdev_alloc(void);
+
+static inline void cdev_put(struct cdev *p)
+{
+ if (p)
+ kobject_put(&p->kobj);
+}
+
+struct kobject *cdev_get(struct cdev *);
+
+int cdev_add(struct cdev *, dev_t, unsigned);
+
+void cdev_del(struct cdev *);
+
+void cdev_unmap(dev_t, unsigned);
+
+#endif
+#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1b7fac010f1f..6b32c6ab8727 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1056,10 +1056,8 @@ extern void bd_release(struct block_device *);
extern void blk_run_queues(void);
/* fs/char_dev.c */
-extern int alloc_chrdev_region(dev_t *, unsigned, char *,
- struct file_operations *);
-extern int register_chrdev_region(dev_t, unsigned, char *,
- struct file_operations *);
+extern int alloc_chrdev_region(dev_t *, unsigned, char *);
+extern int register_chrdev_region(dev_t, unsigned, char *);
extern int register_chrdev(unsigned int, const char *,
struct file_operations *);
extern int unregister_chrdev(unsigned int, const char *);
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index d8d9fc435a3f..ef234da28a8c 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -117,9 +117,11 @@
#include <linux/fs.h>
#include <linux/list.h>
+#include <linux/cdev.h>
struct tty_driver {
int magic; /* magic number for this structure */
+ struct cdev cdev;
struct module *owner;
const char *driver_name;
const char *name;