diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-05-23 11:50:05 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-05-23 11:50:05 +0000 |
commit | 6286c33bf78c2a37975c12d9974d71f46d2d973b (patch) | |
tree | fe2a8403453beb2b5cfe3199fb158efd07dfaa64 | |
parent | 1f43b454c7dad05be08c70021bdd2f81206916a1 (diff) | |
download | FreeBSD-src-6286c33bf78c2a37975c12d9974d71f46d2d973b.zip FreeBSD-src-6286c33bf78c2a37975c12d9974d71f46d2d973b.tar.gz |
Add support for "cdev_add_ext()" to the LinuxKPI.
Obtained from: kmacy @
MFC after: 1 week
Sponsored by: Mellanox Technologies
-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 84b7b70..e60ee15 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) { |