Commit 415db1e8 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: use request_module()

From: Domen Puncer <domen@coderock.org>
parent 5f49a784
...@@ -456,9 +456,7 @@ void cdev_init(struct cdev *cdev, struct file_operations *fops) ...@@ -456,9 +456,7 @@ void cdev_init(struct cdev *cdev, struct file_operations *fops)
static struct kobject *base_probe(dev_t dev, int *part, void *data) static struct kobject *base_probe(dev_t dev, int *part, void *data)
{ {
char name[30]; request_module("char-major-%d", MAJOR(dev));
sprintf(name, "char-major-%d", MAJOR(dev));
request_module(name);
return NULL; return NULL;
} }
......
...@@ -157,9 +157,7 @@ struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name) ...@@ -157,9 +157,7 @@ struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name)
* If scheduler not found, load the module and search again * If scheduler not found, load the module and search again
*/ */
if (sched == NULL) { if (sched == NULL) {
char module_name[IP_VS_SCHEDNAME_MAXLEN+8]; request_module("ip_vs_%s", sched_name);
sprintf(module_name,"ip_vs_%s", sched_name);
request_module(module_name);
sched = ip_vs_sched_getbyname(sched_name); sched = ip_vs_sched_getbyname(sched_name);
} }
......
...@@ -148,24 +148,19 @@ static snd_timer_t *snd_timer_find(snd_timer_id_t *tid) ...@@ -148,24 +148,19 @@ static snd_timer_t *snd_timer_find(snd_timer_id_t *tid)
static void snd_timer_request(snd_timer_id_t *tid) static void snd_timer_request(snd_timer_id_t *tid)
{ {
char str[32];
switch (tid->dev_class) { switch (tid->dev_class) {
case SNDRV_TIMER_CLASS_GLOBAL: case SNDRV_TIMER_CLASS_GLOBAL:
if (tid->device >= timer_limit) if (tid->device < timer_limit)
return; request_module("snd-timer-%i", tid->device);
sprintf(str, "snd-timer-%i", tid->device);
break; break;
case SNDRV_TIMER_CLASS_CARD: case SNDRV_TIMER_CLASS_CARD:
case SNDRV_TIMER_CLASS_PCM: case SNDRV_TIMER_CLASS_PCM:
if (tid->card >= snd_ecards_limit) if (tid->card < snd_ecards_limit)
return; request_module("snd-card-%i", tid->card);
sprintf(str, "snd-card-%i", tid->card);
break; break;
default: default:
return; break;
} }
request_module(str);
} }
#endif #endif
......
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