diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-20 11:25:44 -0400 |
commit | af52739b922f656eb1f39016fabaabe4baeda2e2 (patch) | |
tree | 79a7aa810d0493cd0cf4adebac26d37f12e8b545 /drivers/base/module.c | |
parent | 25ed6a5e97809129a1bc852b6b5c7d03baa112c4 (diff) | |
parent | 33688abb2802ff3a230bd2441f765477b94cc89e (diff) |
Merge 4.7-rc4 into staging-next
We want the fixes in here, and we can resolve a merge issue in
drivers/iio/industrialio-trigger.c
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/module.c')
-rw-r--r-- | drivers/base/module.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/base/module.c b/drivers/base/module.c index db930d3ee312..2a215780eda2 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c | |||
@@ -24,10 +24,12 @@ static char *make_driver_name(struct device_driver *drv) | |||
24 | 24 | ||
25 | static void module_create_drivers_dir(struct module_kobject *mk) | 25 | static void module_create_drivers_dir(struct module_kobject *mk) |
26 | { | 26 | { |
27 | if (!mk || mk->drivers_dir) | 27 | static DEFINE_MUTEX(drivers_dir_mutex); |
28 | return; | ||
29 | 28 | ||
30 | mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); | 29 | mutex_lock(&drivers_dir_mutex); |
30 | if (mk && !mk->drivers_dir) | ||
31 | mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); | ||
32 | mutex_unlock(&drivers_dir_mutex); | ||
31 | } | 33 | } |
32 | 34 | ||
33 | void module_add_driver(struct module *mod, struct device_driver *drv) | 35 | void module_add_driver(struct module *mod, struct device_driver *drv) |