diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index c325e926de8a310f09eb15b3e0548a51d67e2e96..1798b779a25a10993e767a469ee860317016a992 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -39,10 +39,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - #include "cpia.h" static int video_nr = -1; diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index b26b563a0b0a299a98bd7c4ef7114878fdb66d07..9e4f50639975308c0ca23ed446f1aa26d8e4f4df 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c @@ -45,10 +45,6 @@ #include -#ifdef CONFIG_KMOD -#include -#endif - #include "usbvision.h" static unsigned int core_debug; diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index e10b256aeba4bc103675937df43ae71512336904..77aeb39b2750b1a34e660e3a733209e89da792af 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -69,10 +69,6 @@ #include -#ifdef CONFIG_KMOD -#include -#endif - #include "usbvision.h" #include "usbvision-cards.h" diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 79937d1031fc81283baf06abc62c5bc45a4c8409..928cb4037372e963f648c96656a65b9058baf98a 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -36,10 +36,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - static unsigned int debug; module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "enable debug messages"); diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 20c3be8617ea62eb583fd7827ad6c0c019de6d63..846763d7349e3ca73c3dc56f077da8bf98ca08c6 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -60,10 +60,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif - #include MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr"); diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index 8ec57df1904f1e83d4940f395060459ecde38733..1efc5f3462c6ce8fa6e8edc45c45c7aceb445499 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c @@ -30,10 +30,7 @@ #include #include #include - -#ifdef CONFIG_KMOD #include -#endif #include #include @@ -4634,7 +4631,7 @@ static int __init vino_module_init(void) } vino_init_stage++; -#if defined(CONFIG_KMOD) && defined(MODULE) +#ifdef MODULE request_module("saa7191"); request_module("indycam"); #endif diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c index 11edf79f57be328a0f6a196f7d849776c3235a39..dcd45dbd82dcfa0424b900f78a495d85f5a3ec9e 100644 --- a/drivers/media/video/w9968cf.c +++ b/drivers/media/video/w9968cf.c @@ -111,7 +111,7 @@ static int specific_debug = W9968CF_SPECIFIC_DEBUG; static unsigned int param_nv[24]; /* number of values per parameter */ -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES module_param(ovmod_load, bool, 0644); #endif module_param(simcams, ushort, 0644); @@ -144,7 +144,7 @@ module_param(debug, ushort, 0644); module_param(specific_debug, bool, 0644); #endif -#ifdef CONFIG_KMOD +#ifdef CONFIG_MODULES MODULE_PARM_DESC(ovmod_load, "\n<0|1> Automatic 'ovcamchip' module loading." "\n0 disabled, 1 enabled." diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index edb90b58a9b16980bd42066f6026bbd1ca7c0667..9a06dc93ee0d36a14428b618d810fb2ece02140d 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -564,10 +564,8 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types, for ( ; ret <= 0 && *types; types++) { parser = get_partition_parser(*types); -#ifdef CONFIG_KMOD if (!parser && !request_module("%s", *types)) parser = get_partition_parser(*types); -#endif if (!parser) { printk(KERN_NOTICE "%s partition parsing not available\n", *types); diff --git a/drivers/net/irda/sir_dongle.c b/drivers/net/irda/sir_dongle.c index 36030241f7a9cf72102f09a019cae9ca54f0e169..2a9930e6e2afef50c5e3e711d5232bc8f9aead96 100644 --- a/drivers/net/irda/sir_dongle.c +++ b/drivers/net/irda/sir_dongle.c @@ -67,9 +67,7 @@ int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type) const struct dongle_driver *drv = NULL; int err = -EINVAL; -#ifdef CONFIG_KMOD request_module("irda-dongle-%d", type); -#endif if (dev->dongle_drv != NULL) return -EBUSY; diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 0ca0fcbb7c01f5dcb1f840dd31ca24d1696a83e6..94818ee3cef5d3a8cb0cf62fbd960a128fb947b9 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -2127,13 +2127,9 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg) || ccp_option[1] < 2 || ccp_option[1] > data.length) goto out; - cp = find_compressor(ccp_option[0]); -#ifdef CONFIG_KMOD - if (!cp) { - request_module("ppp-compress-%d", ccp_option[0]); - cp = find_compressor(ccp_option[0]); - } -#endif /* CONFIG_KMOD */ + cp = try_then_request_module( + find_compressor(ccp_option[0]), + "ppp-compress-%d", ccp_option[0]); if (!cp) goto out; diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index c6898c1fc54d95de595fa990fc7b0977149c796a..03aecc97fb453d32eefb596dddba3f6286d909df 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c @@ -115,13 +115,8 @@ static int pppox_create(struct net *net, struct socket *sock, int protocol) goto out; rc = -EPROTONOSUPPORT; -#ifdef CONFIG_KMOD - if (!pppox_protos[protocol]) { - char buffer[32]; - sprintf(buffer, "pppox-proto-%d", protocol); - request_module(buffer); - } -#endif + if (!pppox_protos[protocol]) + request_module("pppox-proto-%d", protocol); if (!pppox_protos[protocol] || !try_module_get(pppox_protos[protocol]->owner)) goto out; diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index 0737570030f5e85459b4f926e3a4e8a7aaa09b3d..3f18bb9abad0f79bdf736eeed0d07f740d1ea5d8 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c @@ -28,9 +28,7 @@ #include #include #include -#ifdef CONFIG_KMOD #include -#endif #include #include #include @@ -837,13 +835,6 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) return (cnt) ? cnt : err; } -#ifdef CONFIG_KMOD -static void try_to_load(int fb) -{ - request_module("fb%d", fb); -} -#endif /* CONFIG_KMOD */ - int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { @@ -1086,10 +1077,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, return -EINVAL; if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) return -EINVAL; -#ifdef CONFIG_KMOD if (!registered_fb[con2fb.framebuffer]) - try_to_load(con2fb.framebuffer); -#endif /* CONFIG_KMOD */ + request_module("fb%d", con2fb.framebuffer); if (!registered_fb[con2fb.framebuffer]) return -EINVAL; event.info = info; @@ -1327,10 +1316,8 @@ fb_open(struct inode *inode, struct file *file) if (fbidx >= FB_MAX) return -ENODEV; lock_kernel(); -#ifdef CONFIG_KMOD if (!(info = registered_fb[fbidx])) - try_to_load(fbidx); -#endif /* CONFIG_KMOD */ + request_module("fb%d", fbidx); if (!(info = registered_fb[fbidx])) { res = -ENODEV; goto out; diff --git a/fs/char_dev.c b/fs/char_dev.c index 3cb7cda3d780e95026142398f4c52cdf565d93b6..262fa10e213d571c4d14e1c6b08a3c5861e55e03 100644 --- a/fs/char_dev.c +++ b/fs/char_dev.c @@ -22,9 +22,6 @@ #include #include -#ifdef CONFIG_KMOD -#include -#endif #include "internal.h" /* diff --git a/fs/exec.c b/fs/exec.c index cfb5656b2cdc1072cebe25b8bc9239efbf3e21bb..a41e7902ed0bf9ef9e2cd600c31b1acda0576ed4 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -50,15 +50,12 @@ #include #include #include +#include #include #include #include -#ifdef CONFIG_KMOD -#include -#endif - #ifdef __alpha__ /* for /sbin/loader handling in search_binary_handler() */ #include @@ -1245,8 +1242,8 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs) read_unlock(&binfmt_lock); if (retval != -ENOEXEC || bprm->mm == NULL) { break; -#ifdef CONFIG_KMOD - }else{ +#ifdef CONFIG_MODULES + } else { #define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e)) if (printable(bprm->buf[0]) && printable(bprm->buf[1]) && diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c index 64965e1c21c46ca2dcb9aae20611a0725e9d4f4b..9b0efdad89100bd60e5a15954b67ca83495cad56 100644 --- a/fs/nls/nls_base.c +++ b/fs/nls/nls_base.c @@ -13,9 +13,7 @@ #include #include #include -#ifdef CONFIG_KMOD #include -#endif #include static struct nls_table default_table; @@ -215,24 +213,7 @@ static struct nls_table *find_nls(char *charset) struct nls_table *load_nls(char *charset) { - struct nls_table *nls; -#ifdef CONFIG_KMOD - int ret; -#endif - - nls = find_nls(charset); - if (nls) - return nls; - -#ifdef CONFIG_KMOD - ret = request_module("nls_%s", charset); - if (ret != 0) { - printk("Unable to load NLS charset %s\n", charset); - return NULL; - } - nls = find_nls(charset); -#endif - return nls; + return try_then_request_module(find_nls(charset), "nls_%s", charset); } void unload_nls(struct nls_table *nls) diff --git a/kernel/kmod.c b/kernel/kmod.c index ab7dd08472fce4c56311f29d7d3920a4e3bbd500..3d3c3ea3a023376f2ecf8c16b6c89aed39da67f4 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c @@ -113,7 +113,7 @@ int request_module(const char *fmt, ...) return ret; } EXPORT_SYMBOL(request_module); -#endif /* CONFIG_KMOD */ +#endif /* CONFIG_MODULES */ struct subprocess_info { struct work_struct work;