Commit a65e5d78 authored by Johannes Berg's avatar Johannes Berg Committed by Rusty Russell

remove CONFIG_KMOD from drivers

Straight forward conversions to CONFIG_MODULE; many drivers
include <linux/kmod.h> conditionally and then don't have any
other conditional code so remove it from those.
Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Cc: video4linux-list@redhat.com
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-ppp@vger.kernel.org
Cc: dm-devel@redhat.com
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 04ab5918
...@@ -44,14 +44,9 @@ ...@@ -44,14 +44,9 @@
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/freezer.h> #include <linux/freezer.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/file.h> #include <linux/file.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h> #include <linux/kmod.h>
#endif
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -3555,12 +3550,10 @@ static int do_md_run(mddev_t * mddev) ...@@ -3555,12 +3550,10 @@ static int do_md_run(mddev_t * mddev)
} }
} }
#ifdef CONFIG_KMOD
if (mddev->level != LEVEL_NONE) if (mddev->level != LEVEL_NONE)
request_module("md-level-%d", mddev->level); request_module("md-level-%d", mddev->level);
else if (mddev->clevel[0]) else if (mddev->clevel[0])
request_module("md-%s", mddev->clevel); request_module("md-%s", mddev->clevel);
#endif
/* /*
* Drop all container device buffers, from now on * Drop all container device buffers, from now on
......
...@@ -39,10 +39,6 @@ ...@@ -39,10 +39,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include "cpia.h" #include "cpia.h"
static int video_nr = -1; static int video_nr = -1;
......
...@@ -45,10 +45,6 @@ ...@@ -45,10 +45,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include "usbvision.h" #include "usbvision.h"
static unsigned int core_debug; static unsigned int core_debug;
......
...@@ -69,10 +69,6 @@ ...@@ -69,10 +69,6 @@
#include <linux/workqueue.h> #include <linux/workqueue.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include "usbvision.h" #include "usbvision.h"
#include "usbvision-cards.h" #include "usbvision-cards.h"
......
...@@ -36,10 +36,6 @@ ...@@ -36,10 +36,6 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
static unsigned int debug; static unsigned int debug;
module_param(debug, int, 0644); module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages"); MODULE_PARM_DESC(debug, "enable debug messages");
......
...@@ -60,10 +60,6 @@ ...@@ -60,10 +60,6 @@
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-chip-ident.h> #include <media/v4l2-chip-ident.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h>
#endif
#include <linux/videodev2.h> #include <linux/videodev2.h>
MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr"); MODULE_AUTHOR("Bill Dirks, Justin Schoeman, Gerd Knorr");
......
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/version.h> #include <linux/version.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h> #include <linux/kmod.h>
#endif
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/i2c-algo-sgi.h> #include <linux/i2c-algo-sgi.h>
...@@ -4634,7 +4631,7 @@ static int __init vino_module_init(void) ...@@ -4634,7 +4631,7 @@ static int __init vino_module_init(void)
} }
vino_init_stage++; vino_init_stage++;
#if defined(CONFIG_KMOD) && defined(MODULE) #ifdef MODULE
request_module("saa7191"); request_module("saa7191");
request_module("indycam"); request_module("indycam");
#endif #endif
......
...@@ -111,7 +111,7 @@ static int specific_debug = W9968CF_SPECIFIC_DEBUG; ...@@ -111,7 +111,7 @@ static int specific_debug = W9968CF_SPECIFIC_DEBUG;
static unsigned int param_nv[24]; /* number of values per parameter */ static unsigned int param_nv[24]; /* number of values per parameter */
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
module_param(ovmod_load, bool, 0644); module_param(ovmod_load, bool, 0644);
#endif #endif
module_param(simcams, ushort, 0644); module_param(simcams, ushort, 0644);
...@@ -144,7 +144,7 @@ module_param(debug, ushort, 0644); ...@@ -144,7 +144,7 @@ module_param(debug, ushort, 0644);
module_param(specific_debug, bool, 0644); module_param(specific_debug, bool, 0644);
#endif #endif
#ifdef CONFIG_KMOD #ifdef CONFIG_MODULES
MODULE_PARM_DESC(ovmod_load, MODULE_PARM_DESC(ovmod_load,
"\n<0|1> Automatic 'ovcamchip' module loading." "\n<0|1> Automatic 'ovcamchip' module loading."
"\n0 disabled, 1 enabled." "\n0 disabled, 1 enabled."
......
...@@ -564,10 +564,8 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types, ...@@ -564,10 +564,8 @@ int parse_mtd_partitions(struct mtd_info *master, const char **types,
for ( ; ret <= 0 && *types; types++) { for ( ; ret <= 0 && *types; types++) {
parser = get_partition_parser(*types); parser = get_partition_parser(*types);
#ifdef CONFIG_KMOD
if (!parser && !request_module("%s", *types)) if (!parser && !request_module("%s", *types))
parser = get_partition_parser(*types); parser = get_partition_parser(*types);
#endif
if (!parser) { if (!parser) {
printk(KERN_NOTICE "%s partition parsing not available\n", printk(KERN_NOTICE "%s partition parsing not available\n",
*types); *types);
......
...@@ -67,9 +67,7 @@ int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type) ...@@ -67,9 +67,7 @@ int sirdev_get_dongle(struct sir_dev *dev, IRDA_DONGLE type)
const struct dongle_driver *drv = NULL; const struct dongle_driver *drv = NULL;
int err = -EINVAL; int err = -EINVAL;
#ifdef CONFIG_KMOD
request_module("irda-dongle-%d", type); request_module("irda-dongle-%d", type);
#endif
if (dev->dongle_drv != NULL) if (dev->dongle_drv != NULL)
return -EBUSY; return -EBUSY;
......
...@@ -2127,13 +2127,9 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg) ...@@ -2127,13 +2127,9 @@ ppp_set_compress(struct ppp *ppp, unsigned long arg)
|| ccp_option[1] < 2 || ccp_option[1] > data.length) || ccp_option[1] < 2 || ccp_option[1] > data.length)
goto out; goto out;
cp = find_compressor(ccp_option[0]); cp = try_then_request_module(
#ifdef CONFIG_KMOD find_compressor(ccp_option[0]),
if (!cp) { "ppp-compress-%d", ccp_option[0]);
request_module("ppp-compress-%d", ccp_option[0]);
cp = find_compressor(ccp_option[0]);
}
#endif /* CONFIG_KMOD */
if (!cp) if (!cp)
goto out; goto out;
......
...@@ -115,13 +115,8 @@ static int pppox_create(struct net *net, struct socket *sock, int protocol) ...@@ -115,13 +115,8 @@ static int pppox_create(struct net *net, struct socket *sock, int protocol)
goto out; goto out;
rc = -EPROTONOSUPPORT; rc = -EPROTONOSUPPORT;
#ifdef CONFIG_KMOD if (!pppox_protos[protocol])
if (!pppox_protos[protocol]) { request_module("pppox-proto-%d", protocol);
char buffer[32];
sprintf(buffer, "pppox-proto-%d", protocol);
request_module(buffer);
}
#endif
if (!pppox_protos[protocol] || if (!pppox_protos[protocol] ||
!try_module_get(pppox_protos[protocol]->owner)) !try_module_get(pppox_protos[protocol]->owner))
goto out; goto out;
......
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/console.h> #include <linux/console.h>
#ifdef CONFIG_KMOD
#include <linux/kmod.h> #include <linux/kmod.h>
#endif
#include <linux/err.h> #include <linux/err.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/efi.h> #include <linux/efi.h>
...@@ -837,13 +835,6 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) ...@@ -837,13 +835,6 @@ fb_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
return (cnt) ? cnt : err; return (cnt) ? cnt : err;
} }
#ifdef CONFIG_KMOD
static void try_to_load(int fb)
{
request_module("fb%d", fb);
}
#endif /* CONFIG_KMOD */
int int
fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) 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, ...@@ -1086,10 +1077,8 @@ fb_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
return -EINVAL; return -EINVAL;
if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX) if (con2fb.framebuffer < 0 || con2fb.framebuffer >= FB_MAX)
return -EINVAL; return -EINVAL;
#ifdef CONFIG_KMOD
if (!registered_fb[con2fb.framebuffer]) if (!registered_fb[con2fb.framebuffer])
try_to_load(con2fb.framebuffer); request_module("fb%d", con2fb.framebuffer);
#endif /* CONFIG_KMOD */
if (!registered_fb[con2fb.framebuffer]) if (!registered_fb[con2fb.framebuffer])
return -EINVAL; return -EINVAL;
event.info = info; event.info = info;
...@@ -1327,10 +1316,8 @@ fb_open(struct inode *inode, struct file *file) ...@@ -1327,10 +1316,8 @@ fb_open(struct inode *inode, struct file *file)
if (fbidx >= FB_MAX) if (fbidx >= FB_MAX)
return -ENODEV; return -ENODEV;
lock_kernel(); lock_kernel();
#ifdef CONFIG_KMOD
if (!(info = registered_fb[fbidx])) if (!(info = registered_fb[fbidx]))
try_to_load(fbidx); request_module("fb%d", fbidx);
#endif /* CONFIG_KMOD */
if (!(info = registered_fb[fbidx])) { if (!(info = registered_fb[fbidx])) {
res = -ENODEV; res = -ENODEV;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment