diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2016-05-23 11:50:05 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2016-05-23 11:50:05 +0000 |
| commit | ed5f7812704cd0296ee9695037e869e000f9a881 (patch) | |
| tree | fe2a8403453beb2b5cfe3199fb158efd07dfaa64 /sys/compat/linuxkpi/common/include/linux/cdev.h | |
| parent | 299f29203ad206287f104c95f5a29e65674f7f94 (diff) | |
Notes
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux/cdev.h')
| -rw-r--r-- | sys/compat/linuxkpi/common/include/linux/cdev.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index 84b7b70947d1..e60ee1546b04 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -91,6 +91,18 @@ cdev_add(struct linux_cdev *cdev, dev_t dev, unsigned count) return (0); } +static inline int +cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) +{ + cdev->cdev = make_dev(&linuxcdevsw, MINOR(dev), uid, gid, mode, + "%s/%d", kobject_name(&cdev->kobj), MINOR(dev)); + cdev->dev = dev; + cdev->cdev->si_drv1 = cdev; + + kobject_get(cdev->kobj.parent); + return (0); +} + static inline void cdev_del(struct linux_cdev *cdev) { |
