X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fcore%2Finit.c;h=e3338d6071efb993ae9370bf634fdf28ebb27e42;hb=909c0faa8fd8a68fab34f099fe8469e608d8b362;hp=2cb7099eb1e1b994fa12f7c24da0189f98c5fa5a;hpb=ebc283118ee448dcb6e6cae74a8a43f17a1ccc3f;p=linux-2.6-omap-h63xx.git diff --git a/sound/core/init.c b/sound/core/init.c index 2cb7099eb1e..e3338d6071e 100644 --- a/sound/core/init.c +++ b/sound/core/init.c @@ -19,7 +19,6 @@ * */ -#include #include #include #include @@ -43,6 +42,40 @@ EXPORT_SYMBOL(snd_cards); static DEFINE_MUTEX(snd_card_mutex); +static char *slots[SNDRV_CARDS]; +module_param_array(slots, charp, NULL, 0444); +MODULE_PARM_DESC(slots, "Module names assigned to the slots."); + +/* return non-zero if the given index is already reserved for another + * module via slots option + */ +static int module_slot_mismatch(struct module *module, int idx) +{ +#ifdef MODULE + char *s1, *s2; + if (!module || !module->name || !slots[idx]) + return 0; + s1 = slots[idx]; + s2 = module->name; + /* compare module name strings + * hyphens are handled as equivalent with underscore + */ + for (;;) { + char c1 = *s1++; + char c2 = *s2++; + if (c1 == '-') + c1 = '_'; + if (c2 == '-') + c2 = '_'; + if (c1 != c2) + return 1; + if (!c1) + break; + } +#endif + return 0; +} + #if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int free_flag); EXPORT_SYMBOL(snd_mixer_oss_notify_callback); @@ -115,6 +148,8 @@ struct snd_card *snd_card_new(int idx, const char *xid, for (idx2 = 0; idx2 < SNDRV_CARDS; idx2++) /* idx == -1 == 0xffff means: take any free slot */ if (~snd_cards_lock & idx & 1<= snd_ecards_limit) snd_ecards_limit = idx + 1; @@ -304,8 +339,8 @@ int snd_card_disconnect(struct snd_card *card) list_add(&mfile->shutdown_list, &shutdown_files); spin_unlock(&shutdown_lock); - fops_get(&snd_shutdown_f_ops); mfile->file->f_op = &snd_shutdown_f_ops; + fops_get(mfile->file->f_op); mfile = mfile->next; }