diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-05-11 18:51:35 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2021-05-11 19:00:23 +0000 |
commit | 67807f5066a012254da9a4535c0f225377afb66d (patch) | |
tree | 1ebafe3e9fe5da768ca3c2d044edc867c27afe39 | |
parent | 904390b4787d2e4a0d9d8ca9cb0d6da5a4fb320c (diff) | |
download | src-67807f5066a012254da9a4535c0f225377afb66d.tar.gz src-67807f5066a012254da9a4535c0f225377afb66d.zip |
cdev_del() should only put it's kernel object in the LinuxKPI.
The destructor takes care of the rest.
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/cdev.h | 4 | ||||
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_compat.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h index 2a472da91866..bdfb7e76c9a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/cdev.h +++ b/sys/compat/linuxkpi/common/include/linux/cdev.h @@ -135,13 +135,9 @@ cdev_add_ext(struct linux_cdev *cdev, dev_t dev, uid_t uid, gid_t gid, int mode) return (0); } -void linux_destroy_dev(struct linux_cdev *); - static inline void cdev_del(struct linux_cdev *cdev) { - - linux_destroy_dev(cdev); kobject_put(&cdev->kobj); } diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c index ee41e5e2b30d..dcbbc3a80b8a 100644 --- a/sys/compat/linuxkpi/common/src/linux_compat.c +++ b/sys/compat/linuxkpi/common/src/linux_compat.c @@ -115,6 +115,7 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compat"); #undef cdev #define RB_ROOT(head) (head)->rbh_root +static void linux_destroy_dev(struct linux_cdev *); static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); @@ -2243,7 +2244,7 @@ linux_cdev_static_release(struct kobject *kobj) kobject_put(kobj->parent); } -void +static void linux_destroy_dev(struct linux_cdev *ldev) { |