blob: 1e29b13d00621ee32fcb50f1e08b4dd93b62afcd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_CDEV_H
2#define _LINUX_CDEV_H
3#ifdef __KERNEL__
4
Jan Engelhardt5ec68b22006-12-06 20:36:14 -08005#include <linux/kobject.h>
6#include <linux/kdev_t.h>
7#include <linux/list.h>
8
Jan Engelhardt3d8b3032007-01-29 13:19:56 -08009struct file_operations;
10struct inode;
11struct module;
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013struct cdev {
14 struct kobject kobj;
15 struct module *owner;
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080016 const struct file_operations *ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 struct list_head list;
18 dev_t dev;
19 unsigned int count;
20};
21
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080022void cdev_init(struct cdev *, const struct file_operations *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24struct cdev *cdev_alloc(void);
25
26void cdev_put(struct cdev *p);
27
28int cdev_add(struct cdev *, dev_t, unsigned);
29
30void cdev_del(struct cdev *);
31
32void cd_forget(struct inode *);
33
David Howells5da61852006-09-27 01:50:16 -070034extern struct backing_dev_info directly_mappable_cdev_bdi;
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036#endif
37#endif