diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 11:44:01 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:28:58 -0500 |
commit | 73e77ba0235532bd7523ba90883d325f6e095acf (patch) | |
tree | d22f29805ade9e78bd5f1802590d42f6e121c3c1 /sound/isa | |
parent | 00a4e3d9f8df8a90966b75d517154718b4a2242a (diff) |
[ALSA] Add error messages
Add error messages in the critial error path to be more verbose.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r-- | sound/isa/opl3sa2.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index b923de9b321d..aafe5565b6e5 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -496,21 +496,29 @@ static int __init snd_opl3sa2_mixer(struct snd_opl3sa2 *chip) | |||
496 | /* reassign AUX0 to CD */ | 496 | /* reassign AUX0 to CD */ |
497 | strcpy(id1.name, "Aux Playback Switch"); | 497 | strcpy(id1.name, "Aux Playback Switch"); |
498 | strcpy(id2.name, "CD Playback Switch"); | 498 | strcpy(id2.name, "CD Playback Switch"); |
499 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | 499 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { |
500 | snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); | ||
500 | return err; | 501 | return err; |
502 | } | ||
501 | strcpy(id1.name, "Aux Playback Volume"); | 503 | strcpy(id1.name, "Aux Playback Volume"); |
502 | strcpy(id2.name, "CD Playback Volume"); | 504 | strcpy(id2.name, "CD Playback Volume"); |
503 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | 505 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { |
506 | snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); | ||
504 | return err; | 507 | return err; |
508 | } | ||
505 | /* reassign AUX1 to FM */ | 509 | /* reassign AUX1 to FM */ |
506 | strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; | 510 | strcpy(id1.name, "Aux Playback Switch"); id1.index = 1; |
507 | strcpy(id2.name, "FM Playback Switch"); | 511 | strcpy(id2.name, "FM Playback Switch"); |
508 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | 512 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { |
513 | snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); | ||
509 | return err; | 514 | return err; |
515 | } | ||
510 | strcpy(id1.name, "Aux Playback Volume"); | 516 | strcpy(id1.name, "Aux Playback Volume"); |
511 | strcpy(id2.name, "FM Playback Volume"); | 517 | strcpy(id2.name, "FM Playback Volume"); |
512 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) | 518 | if ((err = snd_ctl_rename_id(card, &id1, &id2)) < 0) { |
519 | snd_printk(KERN_ERR "Cannot rename opl3sa2 control\n"); | ||
513 | return err; | 520 | return err; |
521 | } | ||
514 | /* add OPL3SA2 controls */ | 522 | /* add OPL3SA2 controls */ |
515 | for (idx = 0; idx < ARRAY_SIZE(snd_opl3sa2_controls); idx++) { | 523 | for (idx = 0; idx < ARRAY_SIZE(snd_opl3sa2_controls); idx++) { |
516 | if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_opl3sa2_controls[idx], chip))) < 0) | 524 | if ((err = snd_ctl_add(card, kctl = snd_ctl_new1(&snd_opl3sa2_controls[idx], chip))) < 0) |
@@ -575,8 +583,10 @@ static int __init snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip, | |||
575 | int err; | 583 | int err; |
576 | 584 | ||
577 | cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); | 585 | cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); |
578 | if (!cfg) | 586 | if (!cfg) { |
587 | snd_printk(KERN_ERR PFX "cannot allocate pnp cfg\n"); | ||
579 | return -ENOMEM; | 588 | return -ENOMEM; |
589 | } | ||
580 | /* PnP initialization */ | 590 | /* PnP initialization */ |
581 | pnp_init_resource_table(cfg); | 591 | pnp_init_resource_table(cfg); |
582 | if (sb_port[dev] != SNDRV_AUTO_PORT) | 592 | if (sb_port[dev] != SNDRV_AUTO_PORT) |
@@ -597,7 +607,7 @@ static int __init snd_opl3sa2_pnp(int dev, struct snd_opl3sa2 *chip, | |||
597 | pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); | 607 | pnp_resource_change(&cfg->irq_resource[0], irq[dev], 1); |
598 | err = pnp_manual_config_dev(pdev, cfg, 0); | 608 | err = pnp_manual_config_dev(pdev, cfg, 0); |
599 | if (err < 0) | 609 | if (err < 0) |
600 | snd_printk(KERN_ERR "PnP manual resources are invalid, using auto config\n"); | 610 | snd_printk(KERN_WARNING "PnP manual resources are invalid, using auto config\n"); |
601 | err = pnp_activate_dev(pdev); | 611 | err = pnp_activate_dev(pdev); |
602 | if (err < 0) { | 612 | if (err < 0) { |
603 | kfree(cfg); | 613 | kfree(cfg); |
@@ -784,8 +794,11 @@ static int __devinit snd_opl3sa2_pnp_cdetect(struct pnp_card_link *pcard, | |||
784 | struct snd_card *card; | 794 | struct snd_card *card; |
785 | 795 | ||
786 | pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL); | 796 | pdev = pnp_request_card_device(pcard, id->devs[0].id, NULL); |
787 | if (pdev == NULL) | 797 | if (pdev == NULL) { |
798 | snd_printk(KERN_ERR PFX "can't get pnp device from id '%s'\n", | ||
799 | id->devs[0].id); | ||
788 | return -EBUSY; | 800 | return -EBUSY; |
801 | } | ||
789 | for (; dev < SNDRV_CARDS; dev++) { | 802 | for (; dev < SNDRV_CARDS; dev++) { |
790 | if (enable[dev] && isapnp[dev]) | 803 | if (enable[dev] && isapnp[dev]) |
791 | break; | 804 | break; |