diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-04-26 08:13:44 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-11 10:56:11 -0400 |
commit | b7dd2b349a9fa9e4347780c2bbb41e51484b5bb5 (patch) | |
tree | f5b896fd062a410e46bc35963fe15cdaed38f654 /sound/pci/korg1212 | |
parent | f223a9fc3d5707c354588570e2cf1f3abf6b1f84 (diff) |
[ALSA] Don't use request_firmware if internal firmwares are defined
Don't use request_firmware() if the internal firmwares are defined
via Kconfig. Otherwise it results in a significant delay at loading
time (minutes).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/korg1212')
-rw-r--r-- | sound/pci/korg1212/korg1212.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index e2e59cae2f6e..bd7c816bf6a7 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c | |||
@@ -2340,26 +2340,25 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev * | |||
2340 | korg1212->AdatTimeCodePhy = korg1212->sharedBufferPhy + | 2340 | korg1212->AdatTimeCodePhy = korg1212->sharedBufferPhy + |
2341 | offsetof(struct KorgSharedBuffer, AdatTimeCode); | 2341 | offsetof(struct KorgSharedBuffer, AdatTimeCode); |
2342 | 2342 | ||
2343 | #ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL | ||
2344 | dsp_code = &static_dsp_code; | ||
2345 | #else | ||
2343 | err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev); | 2346 | err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev); |
2344 | if (err < 0) { | 2347 | if (err < 0) { |
2345 | release_firmware(dsp_code); | 2348 | release_firmware(dsp_code); |
2346 | #ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL | ||
2347 | dsp_code = &static_dsp_code; | ||
2348 | #else | ||
2349 | snd_printk(KERN_ERR "firmware not available\n"); | 2349 | snd_printk(KERN_ERR "firmware not available\n"); |
2350 | snd_korg1212_free(korg1212); | 2350 | snd_korg1212_free(korg1212); |
2351 | return err; | 2351 | return err; |
2352 | #endif | ||
2353 | } | 2352 | } |
2353 | #endif | ||
2354 | 2354 | ||
2355 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), | 2355 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), |
2356 | dsp_code->size, &korg1212->dma_dsp) < 0) { | 2356 | dsp_code->size, &korg1212->dma_dsp) < 0) { |
2357 | snd_printk(KERN_ERR "korg1212: cannot allocate dsp code memory (%zd bytes)\n", dsp_code->size); | 2357 | snd_printk(KERN_ERR "korg1212: cannot allocate dsp code memory (%zd bytes)\n", dsp_code->size); |
2358 | snd_korg1212_free(korg1212); | 2358 | snd_korg1212_free(korg1212); |
2359 | #ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL | 2359 | #ifndef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL |
2360 | if (dsp_code != &static_dsp_code) | 2360 | release_firmware(dsp_code); |
2361 | #endif | 2361 | #endif |
2362 | release_firmware(dsp_code); | ||
2363 | return -ENOMEM; | 2362 | return -ENOMEM; |
2364 | } | 2363 | } |
2365 | 2364 | ||
@@ -2369,10 +2368,9 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev * | |||
2369 | 2368 | ||
2370 | memcpy(korg1212->dma_dsp.area, dsp_code->data, dsp_code->size); | 2369 | memcpy(korg1212->dma_dsp.area, dsp_code->data, dsp_code->size); |
2371 | 2370 | ||
2372 | #ifdef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL | 2371 | #ifndef CONFIG_SND_KORG1212_FIRMWARE_IN_KERNEL |
2373 | if (dsp_code != &static_dsp_code) | 2372 | release_firmware(dsp_code); |
2374 | #endif | 2373 | #endif |
2375 | release_firmware(dsp_code); | ||
2376 | 2374 | ||
2377 | rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_RebootCard, 0, 0, 0, 0); | 2375 | rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_RebootCard, 0, 0, 0, 0); |
2378 | 2376 | ||