]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/cdev.h
Merge tag 'for-linus-20170825' of git://git.infradead.org/linux-mtd
[mirror_ubuntu-artful-kernel.git] / include / linux / cdev.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_CDEV_H
2#define _LINUX_CDEV_H
1da177e4 3
5ec68b2e
JE
4#include <linux/kobject.h>
5#include <linux/kdev_t.h>
6#include <linux/list.h>
233ed09d 7#include <linux/device.h>
5ec68b2e 8
3d8b3036
JE
9struct file_operations;
10struct inode;
11struct module;
12
1da177e4
LT
13struct cdev {
14 struct kobject kobj;
15 struct module *owner;
99ac48f5 16 const struct file_operations *ops;
1da177e4
LT
17 struct list_head list;
18 dev_t dev;
19 unsigned int count;
3859a271 20} __randomize_layout;
1da177e4 21
99ac48f5 22void cdev_init(struct cdev *, const struct file_operations *);
1da177e4
LT
23
24struct cdev *cdev_alloc(void);
25
26void cdev_put(struct cdev *p);
27
28int cdev_add(struct cdev *, dev_t, unsigned);
29
233ed09d
LG
30void cdev_set_parent(struct cdev *p, struct kobject *kobj);
31int cdev_device_add(struct cdev *cdev, struct device *dev);
32void cdev_device_del(struct cdev *cdev, struct device *dev);
33
1da177e4
LT
34void cdev_del(struct cdev *);
35
36void cd_forget(struct inode *);
37
38#endif