| 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ | 
|---|
| 2 | #ifndef __LINUX_KMOD_H__ | 
|---|
| 3 | #define __LINUX_KMOD_H__ | 
|---|
| 4 |  | 
|---|
| 5 | /* | 
|---|
| 6 | *	include/linux/kmod.h | 
|---|
| 7 | */ | 
|---|
| 8 |  | 
|---|
| 9 | #include <linux/umh.h> | 
|---|
| 10 | #include <linux/gfp.h> | 
|---|
| 11 | #include <linux/stddef.h> | 
|---|
| 12 | #include <linux/errno.h> | 
|---|
| 13 | #include <linux/compiler.h> | 
|---|
| 14 | #include <linux/workqueue.h> | 
|---|
| 15 | #include <linux/sysctl.h> | 
|---|
| 16 |  | 
|---|
| 17 | #ifdef CONFIG_MODULES | 
|---|
| 18 | /* modprobe exit status on success, -ve on error.  Return value | 
|---|
| 19 | * usually useless though. */ | 
|---|
| 20 | extern __printf(2, 3) | 
|---|
| 21 | int __request_module(bool wait, const char *name, ...); | 
|---|
| 22 | #define request_module(mod...) __request_module(true, mod) | 
|---|
| 23 | #define request_module_nowait(mod...) __request_module(false, mod) | 
|---|
| 24 | #define try_then_request_module(x, mod...) \ | 
|---|
| 25 | ((x) ?: (__request_module(true, mod), (x))) | 
|---|
| 26 | #else | 
|---|
| 27 | static inline int request_module(const char *name, ...) { return -ENOSYS; } | 
|---|
| 28 | static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; } | 
|---|
| 29 | #define try_then_request_module(x, mod...) (x) | 
|---|
| 30 | #endif | 
|---|
| 31 |  | 
|---|
| 32 | #endif /* __LINUX_KMOD_H__ */ | 
|---|
| 33 |  | 
|---|