Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa:
[ALSA] hda-intel - Add check of MSI availabity
[ALSA] version 1.0.13
[ALSA] Fix addition of user-defined boolean controls
[ALSA] Fix AC97 power-saving mode
[ALSA] Fix re-use of va_list
[ALSA] hda_intel: add ATI RS690 HDMI audio support
[ALSA] hda-codec - Add model entry for ASUS U5F laptop
[ALSA] Fix dependency of snd-adlib driver in Kconfig
[ALSA] Various fixes for suspend/resume of ALSA PCI drivers
[ALSA] hda-codec - Fix assignment of PCM devices for Realtek codecs
[ALSA] sound/isa/opti9xx/opti92x-ad1848.c: check kmalloc() return value
[ALSA] sound/isa/ad1816a/ad1816a.c: check kmalloc() return value
[ALSA] sound/isa/cmi8330.c: check kmalloc() return value
[ALSA] sound/isa/gus/interwave.c: check kmalloc() return value

+330 -168
+1 -1
include/sound/version.h
··· 1 1 /* include/version.h. Generated by alsa/ksync script. */ 2 2 #define CONFIG_SND_VERSION "1.0.13" 3 - #define CONFIG_SND_DATE " (Fri Oct 06 18:28:19 2006 UTC)" 3 + #define CONFIG_SND_DATE " (Sun Oct 22 08:56:16 2006 UTC)"
-4
sound/core/control.c
··· 1018 1018 } 1019 1019 switch (info->type) { 1020 1020 case SNDRV_CTL_ELEM_TYPE_BOOLEAN: 1021 - private_size = sizeof(char); 1022 - if (info->count > 128) 1023 - return -EINVAL; 1024 - break; 1025 1021 case SNDRV_CTL_ELEM_TYPE_INTEGER: 1026 1022 private_size = sizeof(long); 1027 1023 if (info->count > 128)
+4 -1
sound/core/info.c
··· 120 120 len = buffer->len - buffer->size; 121 121 va_start(args, fmt); 122 122 for (;;) { 123 - res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, args); 123 + va_list ap; 124 + va_copy(ap, args); 125 + res = vsnprintf(buffer->buffer + buffer->curr, len, fmt, ap); 126 + va_end(ap); 124 127 if (res < len) 125 128 break; 126 129 err = resize_info_buffer(buffer, buffer->len + PAGE_SIZE);
+1
sound/isa/Kconfig
··· 13 13 14 14 config SND_ADLIB 15 15 tristate "AdLib FM card" 16 + depends on SND 16 17 select SND_OPL3_LIB 17 18 help 18 19 Say Y here to include support for AdLib FM cards.
+2
sound/isa/ad1816a/ad1816a.c
··· 120 120 struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); 121 121 int err; 122 122 123 + if (!cfg) 124 + return -ENOMEM; 123 125 acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); 124 126 if (acard->dev == NULL) { 125 127 kfree(cfg);
+2
sound/isa/cmi8330.c
··· 289 289 struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); 290 290 int err; 291 291 292 + if (!cfg) 293 + return -ENOMEM; 292 294 acard->cap = pnp_request_card_device(card, id->devs[0].id, NULL); 293 295 if (acard->cap == NULL) { 294 296 kfree(cfg);
+2
sound/isa/gus/interwave.c
··· 564 564 struct pnp_resource_table * cfg = kmalloc(sizeof(struct pnp_resource_table), GFP_KERNEL); 565 565 int err; 566 566 567 + if (!cfg) 568 + return -ENOMEM; 567 569 iwcard->dev = pnp_request_card_device(card, id->devs[0].id, NULL); 568 570 if (iwcard->dev == NULL) { 569 571 kfree(cfg);
+2
sound/isa/opti9xx/opti92x-ad1848.c
··· 1683 1683 struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); 1684 1684 int err; 1685 1685 1686 + if (!cfg) 1687 + return -ENOMEM; 1686 1688 chip->dev = pnp_request_card_device(card, pid->devs[0].id, NULL); 1687 1689 if (chip->dev == NULL) { 1688 1690 kfree(cfg);
+2 -6
sound/pci/ac97/ac97_codec.c
··· 570 570 ac97->power_up &= ~(1 << (reg>>1)); 571 571 else 572 572 ac97->power_up |= 1 << (reg>>1); 573 - if (power_save) 574 - update_power_regs(ac97); 573 + update_power_regs(ac97); 575 574 } 576 575 #endif 577 576 return err; ··· 2336 2337 } 2337 2338 } 2338 2339 2339 - if (! power_save) 2340 - return 0; 2341 - 2342 - if (! powerup && ac97->power_workq) 2340 + if (power_save && !powerup && ac97->power_workq) 2343 2341 /* adjust power-down bits after two seconds delay 2344 2342 * (for avoiding loud click noises for many (OSS) apps 2345 2343 * that open/close frequently)
+10 -1
sound/pci/ali5451/ali5451.c
··· 2032 2032 outl(0xffffffff, ALI_REG(chip, ALI_STOP)); 2033 2033 2034 2034 spin_unlock_irq(&chip->reg_lock); 2035 + 2035 2036 pci_disable_device(pci); 2036 2037 pci_save_state(pci); 2038 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2037 2039 return 0; 2038 2040 } 2039 2041 ··· 2050 2048 if (! im) 2051 2049 return 0; 2052 2050 2051 + pci_set_power_state(pci, PCI_D0); 2053 2052 pci_restore_state(pci); 2054 - pci_enable_device(pci); 2053 + if (pci_enable_device(pci) < 0) { 2054 + printk(KERN_ERR "ali5451: pci_enable_device failed, " 2055 + "disabling device\n"); 2056 + snd_card_disconnect(card); 2057 + return -EIO; 2058 + } 2059 + pci_set_master(pci); 2055 2060 2056 2061 spin_lock_irq(&chip->reg_lock); 2057 2062
+8 -3
sound/pci/als300.c
··· 768 768 snd_pcm_suspend_all(chip->pcm); 769 769 snd_ac97_suspend(chip->ac97); 770 770 771 - pci_set_power_state(pci, PCI_D3hot); 772 771 pci_disable_device(pci); 773 772 pci_save_state(pci); 773 + pci_set_power_state(pci, pci_choose_state(pci, state)); 774 774 return 0; 775 775 } 776 776 ··· 779 779 struct snd_card *card = pci_get_drvdata(pci); 780 780 struct snd_als300 *chip = card->private_data; 781 781 782 - pci_restore_state(pci); 783 - pci_enable_device(pci); 784 782 pci_set_power_state(pci, PCI_D0); 783 + pci_restore_state(pci); 784 + if (pci_enable_device(pci) < 0) { 785 + printk(KERN_ERR "als300: pci_enable_device failed, " 786 + "disabling device\n"); 787 + snd_card_disconnect(card); 788 + return -EIO; 789 + } 785 790 pci_set_master(pci); 786 791 787 792 snd_als300_init(chip);
+8 -3
sound/pci/als4000.c
··· 804 804 snd_pcm_suspend_all(chip->pcm); 805 805 snd_sbmixer_suspend(chip); 806 806 807 - pci_set_power_state(pci, PCI_D3hot); 808 807 pci_disable_device(pci); 809 808 pci_save_state(pci); 809 + pci_set_power_state(pci, pci_choose_state(pci, state)); 810 810 return 0; 811 811 } 812 812 ··· 816 816 struct snd_card_als4000 *acard = card->private_data; 817 817 struct snd_sb *chip = acard->chip; 818 818 819 - pci_restore_state(pci); 820 - pci_enable_device(pci); 821 819 pci_set_power_state(pci, PCI_D0); 820 + pci_restore_state(pci); 821 + if (pci_enable_device(pci) < 0) { 822 + printk(KERN_ERR "als4000: pci_enable_device failed, " 823 + "disabling device\n"); 824 + snd_card_disconnect(card); 825 + return -EIO; 826 + } 822 827 pci_set_master(pci); 823 828 824 829 snd_als4000_configure(chip);
+8 -3
sound/pci/atiixp.c
··· 1442 1442 snd_atiixp_aclink_down(chip); 1443 1443 snd_atiixp_chip_stop(chip); 1444 1444 1445 - pci_set_power_state(pci, PCI_D3hot); 1446 1445 pci_disable_device(pci); 1447 1446 pci_save_state(pci); 1447 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1448 1448 return 0; 1449 1449 } 1450 1450 ··· 1454 1454 struct atiixp *chip = card->private_data; 1455 1455 int i; 1456 1456 1457 - pci_restore_state(pci); 1458 - pci_enable_device(pci); 1459 1457 pci_set_power_state(pci, PCI_D0); 1458 + pci_restore_state(pci); 1459 + if (pci_enable_device(pci) < 0) { 1460 + printk(KERN_ERR "atiixp: pci_enable_device failed, " 1461 + "disabling device\n"); 1462 + snd_card_disconnect(card); 1463 + return -EIO; 1464 + } 1460 1465 pci_set_master(pci); 1461 1466 1462 1467 snd_atiixp_aclink_reset(chip);
+8 -3
sound/pci/atiixp_modem.c
··· 1128 1128 snd_atiixp_aclink_down(chip); 1129 1129 snd_atiixp_chip_stop(chip); 1130 1130 1131 - pci_set_power_state(pci, PCI_D3hot); 1132 1131 pci_disable_device(pci); 1133 1132 pci_save_state(pci); 1133 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1134 1134 return 0; 1135 1135 } 1136 1136 ··· 1140 1140 struct atiixp_modem *chip = card->private_data; 1141 1141 int i; 1142 1142 1143 - pci_restore_state(pci); 1144 - pci_enable_device(pci); 1145 1143 pci_set_power_state(pci, PCI_D0); 1144 + pci_restore_state(pci); 1145 + if (pci_enable_device(pci) < 0) { 1146 + printk(KERN_ERR "atiixp-modem: pci_enable_device failed, " 1147 + "disabling device\n"); 1148 + snd_card_disconnect(card); 1149 + return -EIO; 1150 + } 1146 1151 pci_set_master(pci); 1147 1152 1148 1153 snd_atiixp_aclink_reset(chip);
+8 -3
sound/pci/azt3328.c
··· 1903 1903 for (reg = 0; reg < AZF_IO_SIZE_SYNTH_PM / 2; reg++) 1904 1904 chip->saved_regs_synth[reg] = inw(chip->synth_port + reg * 2); 1905 1905 1906 - pci_set_power_state(pci, PCI_D3hot); 1907 1906 pci_disable_device(pci); 1908 1907 pci_save_state(pci); 1908 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1909 1909 return 0; 1910 1910 } 1911 1911 ··· 1916 1916 struct snd_azf3328 *chip = card->private_data; 1917 1917 int reg; 1918 1918 1919 - pci_restore_state(pci); 1920 - pci_enable_device(pci); 1921 1919 pci_set_power_state(pci, PCI_D0); 1920 + pci_restore_state(pci); 1921 + if (pci_enable_device(pci) < 0) { 1922 + printk(KERN_ERR "azt3328: pci_enable_device failed, " 1923 + "disabling device\n"); 1924 + snd_card_disconnect(card); 1925 + return -EIO; 1926 + } 1922 1927 pci_set_master(pci); 1923 1928 1924 1929 for (reg = 0; reg < AZF_IO_SIZE_IO2_PM / 2; reg++)
+8 -3
sound/pci/cmipci.c
··· 3122 3122 /* disable ints */ 3123 3123 snd_cmipci_write(cm, CM_REG_INT_HLDCLR, 0); 3124 3124 3125 - pci_set_power_state(pci, PCI_D3hot); 3126 3125 pci_disable_device(pci); 3127 3126 pci_save_state(pci); 3127 + pci_set_power_state(pci, pci_choose_state(pci, state)); 3128 3128 return 0; 3129 3129 } 3130 3130 ··· 3134 3134 struct cmipci *cm = card->private_data; 3135 3135 int i; 3136 3136 3137 - pci_restore_state(pci); 3138 - pci_enable_device(pci); 3139 3137 pci_set_power_state(pci, PCI_D0); 3138 + pci_restore_state(pci); 3139 + if (pci_enable_device(pci) < 0) { 3140 + printk(KERN_ERR "cmipci: pci_enable_device failed, " 3141 + "disabling device\n"); 3142 + snd_card_disconnect(card); 3143 + return -EIO; 3144 + } 3140 3145 pci_set_master(pci); 3141 3146 3142 3147 /* reset / initialize to a sane state */
+8 -1
sound/pci/cs4281.c
··· 2050 2050 2051 2051 pci_disable_device(pci); 2052 2052 pci_save_state(pci); 2053 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2053 2054 return 0; 2054 2055 } 2055 2056 ··· 2061 2060 unsigned int i; 2062 2061 u32 ulCLK; 2063 2062 2063 + pci_set_power_state(pci, PCI_D0); 2064 2064 pci_restore_state(pci); 2065 - pci_enable_device(pci); 2065 + if (pci_enable_device(pci) < 0) { 2066 + printk(KERN_ERR "cs4281: pci_enable_device failed, " 2067 + "disabling device\n"); 2068 + snd_card_disconnect(card); 2069 + return -EIO; 2070 + } 2066 2071 pci_set_master(pci); 2067 2072 2068 2073 ulCLK = snd_cs4281_peekBA0(chip, BA0_CLKCR1);
+10 -1
sound/pci/cs46xx/cs46xx_lib.c
··· 3687 3687 /* disable CLKRUN */ 3688 3688 chip->active_ctrl(chip, -chip->amplifier); 3689 3689 chip->amplifier = amp_saved; /* restore the status */ 3690 + 3690 3691 pci_disable_device(pci); 3691 3692 pci_save_state(pci); 3693 + pci_set_power_state(pci, pci_choose_state(pci, state)); 3692 3694 return 0; 3693 3695 } 3694 3696 ··· 3700 3698 struct snd_cs46xx *chip = card->private_data; 3701 3699 int amp_saved; 3702 3700 3701 + pci_set_power_state(pci, PCI_D0); 3703 3702 pci_restore_state(pci); 3704 - pci_enable_device(pci); 3703 + if (pci_enable_device(pci) < 0) { 3704 + printk(KERN_ERR "cs46xx: pci_enable_device failed, " 3705 + "disabling device\n"); 3706 + snd_card_disconnect(card); 3707 + return -EIO; 3708 + } 3705 3709 pci_set_master(pci); 3710 + 3706 3711 amp_saved = chip->amplifier; 3707 3712 chip->amplifier = 0; 3708 3713 chip->active_ctrl(chip, 1); /* force to on */
+9 -2
sound/pci/cs5535audio/cs5535audio_pm.c
··· 73 73 snd_ac97_suspend(cs5535au->ac97); 74 74 /* save important regs, then disable aclink in hw */ 75 75 snd_cs5535audio_stop_hardware(cs5535au); 76 + 76 77 pci_disable_device(pci); 77 78 pci_save_state(pci); 78 - 79 + pci_set_power_state(pci, pci_choose_state(pci, state)); 79 80 return 0; 80 81 } 81 82 ··· 88 87 int timeout; 89 88 int i; 90 89 90 + pci_set_power_state(pci, PCI_D0); 91 91 pci_restore_state(pci); 92 - pci_enable_device(pci); 92 + if (pci_enable_device(pci) < 0) { 93 + printk(KERN_ERR "cs5535audio: pci_enable_device failed, " 94 + "disabling device\n"); 95 + snd_card_disconnect(card); 96 + return -EIO; 97 + } 93 98 pci_set_master(pci); 94 99 95 100 /* set LNK_WRM_RST to reset AC link */
+9 -4
sound/pci/emu10k1/emu10k1.c
··· 226 226 227 227 snd_emu10k1_done(emu); 228 228 229 - pci_set_power_state(pci, PCI_D3hot); 230 229 pci_disable_device(pci); 231 230 pci_save_state(pci); 231 + pci_set_power_state(pci, pci_choose_state(pci, state)); 232 232 return 0; 233 233 } 234 234 ··· 237 237 struct snd_card *card = pci_get_drvdata(pci); 238 238 struct snd_emu10k1 *emu = card->private_data; 239 239 240 - pci_restore_state(pci); 241 - pci_enable_device(pci); 242 240 pci_set_power_state(pci, PCI_D0); 241 + pci_restore_state(pci); 242 + if (pci_enable_device(pci) < 0) { 243 + printk(KERN_ERR "emu10k1: pci_enable_device failed, " 244 + "disabling device\n"); 245 + snd_card_disconnect(card); 246 + return -EIO; 247 + } 243 248 pci_set_master(pci); 244 - 249 + 245 250 snd_emu10k1_resume_init(emu); 246 251 snd_emu10k1_efx_resume(emu); 247 252 snd_ac97_resume(emu->ac97);
+9 -3
sound/pci/ens1370.c
··· 2072 2072 udelay(100); 2073 2073 snd_ak4531_suspend(ensoniq->u.es1370.ak4531); 2074 2074 #endif 2075 - pci_set_power_state(pci, PCI_D3hot); 2075 + 2076 2076 pci_disable_device(pci); 2077 2077 pci_save_state(pci); 2078 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2078 2079 return 0; 2079 2080 } 2080 2081 ··· 2084 2083 struct snd_card *card = pci_get_drvdata(pci); 2085 2084 struct ensoniq *ensoniq = card->private_data; 2086 2085 2087 - pci_restore_state(pci); 2088 - pci_enable_device(pci); 2089 2086 pci_set_power_state(pci, PCI_D0); 2087 + pci_restore_state(pci); 2088 + if (pci_enable_device(pci) < 0) { 2089 + printk(KERN_ERR DRIVER_NAME ": pci_enable_device failed, " 2090 + "disabling device\n"); 2091 + snd_card_disconnect(card); 2092 + return -EIO; 2093 + } 2090 2094 pci_set_master(pci); 2091 2095 2092 2096 snd_ensoniq_chip_init(ensoniq);
+24 -5
sound/pci/es1938.c
··· 1481 1481 *d = snd_es1938_reg_read(chip, *s); 1482 1482 1483 1483 outb(0x00, SLIO_REG(chip, IRQCONTROL)); /* disable irqs */ 1484 - if (chip->irq >= 0) 1484 + if (chip->irq >= 0) { 1485 + synchronize_irq(chip->irq); 1485 1486 free_irq(chip->irq, chip); 1487 + chip->irq = -1; 1488 + } 1486 1489 pci_disable_device(pci); 1487 1490 pci_save_state(pci); 1491 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1488 1492 return 0; 1489 1493 } 1490 1494 ··· 1498 1494 struct es1938 *chip = card->private_data; 1499 1495 unsigned char *s, *d; 1500 1496 1497 + pci_set_power_state(pci, PCI_D0); 1501 1498 pci_restore_state(pci); 1502 - pci_enable_device(pci); 1503 - request_irq(pci->irq, snd_es1938_interrupt, 1504 - IRQF_DISABLED|IRQF_SHARED, "ES1938", chip); 1499 + if (pci_enable_device(pci) < 0) { 1500 + printk(KERN_ERR "es1938: pci_enable_device failed, " 1501 + "disabling device\n"); 1502 + snd_card_disconnect(card); 1503 + return -EIO; 1504 + } 1505 + 1506 + if (request_irq(pci->irq, snd_es1938_interrupt, 1507 + IRQF_DISABLED|IRQF_SHARED, "ES1938", chip)) { 1508 + printk(KERN_ERR "es1938: unable to grab IRQ %d, " 1509 + "disabling device\n", pci->irq); 1510 + snd_card_disconnect(card); 1511 + return -EIO; 1512 + } 1505 1513 chip->irq = pci->irq; 1506 1514 snd_es1938_chip_init(chip); 1507 1515 ··· 1572 1556 1573 1557 snd_es1938_free_gameport(chip); 1574 1558 1575 - if (chip->irq >= 0) 1559 + if (chip->irq >= 0) { 1560 + synchronize_irq(chip->irq); 1576 1561 free_irq(chip->irq, chip); 1562 + } 1577 1563 pci_release_regions(chip->pci); 1578 1564 pci_disable_device(chip->pci); 1579 1565 kfree(chip); ··· 1620 1602 spin_lock_init(&chip->mixer_lock); 1621 1603 chip->card = card; 1622 1604 chip->pci = pci; 1605 + chip->irq = -1; 1623 1606 if ((err = pci_request_regions(pci, "ESS Solo-1")) < 0) { 1624 1607 kfree(chip); 1625 1608 pci_disable_device(pci);
+10 -61
sound/pci/es1968.c
··· 432 432 #define ESM_MODE_PLAY 0 433 433 #define ESM_MODE_CAPTURE 1 434 434 435 - /* acpi states */ 436 - enum { 437 - ACPI_D0=0, 438 - ACPI_D1, 439 - ACPI_D2, 440 - ACPI_D3 441 - }; 442 - 443 - /* bits in the acpi masks */ 444 - #define ACPI_12MHZ ( 1 << 15) 445 - #define ACPI_24MHZ ( 1 << 14) 446 - #define ACPI_978 ( 1 << 13) 447 - #define ACPI_SPDIF ( 1 << 12) 448 - #define ACPI_GLUE ( 1 << 11) 449 - #define ACPI__10 ( 1 << 10) /* reserved */ 450 - #define ACPI_PCIINT ( 1 << 9) 451 - #define ACPI_HV ( 1 << 8) /* hardware volume */ 452 - #define ACPI_GPIO ( 1 << 7) 453 - #define ACPI_ASSP ( 1 << 6) 454 - #define ACPI_SB ( 1 << 5) /* sb emul */ 455 - #define ACPI_FM ( 1 << 4) /* fm emul */ 456 - #define ACPI_RB ( 1 << 3) /* ringbus / aclink */ 457 - #define ACPI_MIDI ( 1 << 2) 458 - #define ACPI_GP ( 1 << 1) /* game port */ 459 - #define ACPI_WP ( 1 << 0) /* wave processor */ 460 - 461 - #define ACPI_ALL (0xffff) 462 - #define ACPI_SLEEP (~(ACPI_SPDIF|ACPI_ASSP|ACPI_SB|ACPI_FM| \ 463 - ACPI_MIDI|ACPI_GP|ACPI_WP)) 464 - #define ACPI_NONE (ACPI__10) 465 - 466 - /* these masks indicate which units we care about at 467 - which states */ 468 - static u16 acpi_state_mask[] = { 469 - [ACPI_D0] = ACPI_ALL, 470 - [ACPI_D1] = ACPI_SLEEP, 471 - [ACPI_D2] = ACPI_SLEEP, 472 - [ACPI_D3] = ACPI_NONE 473 - }; 474 - 475 435 476 436 /* APU use in the driver */ 477 437 enum snd_enum_apu_type { ··· 2120 2160 } 2121 2161 2122 2162 /* 2123 - * power management 2124 - */ 2125 - static void snd_es1968_set_acpi(struct es1968 *chip, int state) 2126 - { 2127 - u16 active_mask = acpi_state_mask[state]; 2128 - 2129 - pci_set_power_state(chip->pci, state); 2130 - /* make sure the units we care about are on 2131 - XXX we might want to do this before state flipping? */ 2132 - pci_write_config_word(chip->pci, 0x54, ~ active_mask); 2133 - pci_write_config_word(chip->pci, 0x56, ~ active_mask); 2134 - } 2135 - 2136 - 2137 - /* 2138 2163 * initialize maestro chip 2139 2164 */ 2140 2165 static void snd_es1968_chip_init(struct es1968 *chip) ··· 2141 2196 * IRQs. 2142 2197 */ 2143 2198 2144 - /* do config work at full power */ 2145 - snd_es1968_set_acpi(chip, ACPI_D0); 2146 - 2147 2199 /* Config Reg A */ 2148 2200 pci_read_config_word(pci, ESM_CONFIG_A, &w); 2149 2201 ··· 2339 2397 snd_pcm_suspend_all(chip->pcm); 2340 2398 snd_ac97_suspend(chip->ac97); 2341 2399 snd_es1968_bob_stop(chip); 2342 - snd_es1968_set_acpi(chip, ACPI_D3); 2400 + 2343 2401 pci_disable_device(pci); 2344 2402 pci_save_state(pci); 2403 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2345 2404 return 0; 2346 2405 } 2347 2406 ··· 2356 2413 return 0; 2357 2414 2358 2415 /* restore all our config */ 2416 + pci_set_power_state(pci, PCI_D0); 2359 2417 pci_restore_state(pci); 2360 - pci_enable_device(pci); 2418 + if (pci_enable_device(pci) < 0) { 2419 + printk(KERN_ERR "es1968: pci_enable_device failed, " 2420 + "disabling device\n"); 2421 + snd_card_disconnect(card); 2422 + return -EIO; 2423 + } 2361 2424 pci_set_master(pci); 2425 + 2362 2426 snd_es1968_chip_init(chip); 2363 2427 2364 2428 /* need to restore the base pointers.. */ ··· 2464 2514 if (chip->irq >= 0) 2465 2515 free_irq(chip->irq, (void *)chip); 2466 2516 snd_es1968_free_gameport(chip); 2467 - snd_es1968_set_acpi(chip, ACPI_D3); 2468 2517 chip->master_switch = NULL; 2469 2518 chip->master_volume = NULL; 2470 2519 pci_release_regions(chip->pci);
+8 -3
sound/pci/fm801.c
··· 1531 1531 chip->saved_regs[i] = inw(chip->port + saved_regs[i]); 1532 1532 /* FIXME: tea575x suspend */ 1533 1533 1534 - pci_set_power_state(pci, PCI_D3hot); 1535 1534 pci_disable_device(pci); 1536 1535 pci_save_state(pci); 1536 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1537 1537 return 0; 1538 1538 } 1539 1539 ··· 1543 1543 struct fm801 *chip = card->private_data; 1544 1544 int i; 1545 1545 1546 - pci_restore_state(pci); 1547 - pci_enable_device(pci); 1548 1546 pci_set_power_state(pci, PCI_D0); 1547 + pci_restore_state(pci); 1548 + if (pci_enable_device(pci) < 0) { 1549 + printk(KERN_ERR "fm801: pci_enable_device failed, " 1550 + "disabling device\n"); 1551 + snd_card_disconnect(card); 1552 + return -EIO; 1553 + } 1549 1554 pci_set_master(pci); 1550 1555 1551 1556 snd_fm801_chip_init(chip, 1);
+56 -19
sound/pci/hda/hda_intel.c
··· 86 86 "{ATI, SB450}," 87 87 "{ATI, SB600}," 88 88 "{ATI, RS600}," 89 + "{ATI, RS690}," 89 90 "{VIA, VT8251}," 90 91 "{VIA, VT8237A}," 91 92 "{SiS, SIS966}," ··· 337 336 unsigned int initialized :1; 338 337 unsigned int single_cmd :1; 339 338 unsigned int polling_mode :1; 339 + unsigned int msi :1; 340 340 }; 341 341 342 342 /* driver types */ ··· 398 396 */ 399 397 #define upper_32bit(addr) (sizeof(addr) > 4 ? (u32)((addr) >> 32) : (u32)0) 400 398 399 + static int azx_acquire_irq(struct azx *chip, int do_disconnect); 401 400 402 401 /* 403 402 * Interface for HD codec ··· 537 534 return chip->rirb.res; /* the last value */ 538 535 schedule_timeout_interruptible(1); 539 536 } while (time_after_eq(timeout, jiffies)); 537 + 538 + if (chip->msi) { 539 + snd_printk(KERN_WARNING "hda_intel: No response from codec, " 540 + "disabling MSI...\n"); 541 + free_irq(chip->irq, chip); 542 + chip->irq = -1; 543 + pci_disable_msi(chip->pci); 544 + chip->msi = 0; 545 + if (azx_acquire_irq(chip, 1) < 0) 546 + return -1; 547 + goto again; 548 + } 540 549 541 550 if (!chip->polling_mode) { 542 551 snd_printk(KERN_WARNING "hda_intel: azx_get_response timeout, " ··· 1378 1363 return 0; 1379 1364 } 1380 1365 1366 + static int azx_acquire_irq(struct azx *chip, int do_disconnect) 1367 + { 1368 + if (request_irq(chip->pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, 1369 + "HDA Intel", chip)) { 1370 + printk(KERN_ERR "hda-intel: unable to grab IRQ %d, " 1371 + "disabling device\n", chip->pci->irq); 1372 + if (do_disconnect) 1373 + snd_card_disconnect(chip->card); 1374 + return -1; 1375 + } 1376 + chip->irq = chip->pci->irq; 1377 + return 0; 1378 + } 1379 + 1381 1380 1382 1381 #ifdef CONFIG_PM 1383 1382 /* ··· 1408 1379 snd_pcm_suspend_all(chip->pcm[i]); 1409 1380 snd_hda_suspend(chip->bus, state); 1410 1381 azx_free_cmd_io(chip); 1411 - if (chip->irq >= 0) 1382 + if (chip->irq >= 0) { 1383 + synchronize_irq(chip->irq); 1412 1384 free_irq(chip->irq, chip); 1413 - if (!disable_msi) 1385 + chip->irq = -1; 1386 + } 1387 + if (chip->msi) 1414 1388 pci_disable_msi(chip->pci); 1415 1389 pci_disable_device(pci); 1416 1390 pci_save_state(pci); 1391 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1417 1392 return 0; 1418 1393 } 1419 1394 ··· 1426 1393 struct snd_card *card = pci_get_drvdata(pci); 1427 1394 struct azx *chip = card->private_data; 1428 1395 1396 + pci_set_power_state(pci, PCI_D0); 1429 1397 pci_restore_state(pci); 1430 - pci_enable_device(pci); 1431 - if (!disable_msi) 1432 - pci_enable_msi(pci); 1433 - /* FIXME: need proper error handling */ 1434 - request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, 1435 - "HDA Intel", chip); 1436 - chip->irq = pci->irq; 1398 + if (pci_enable_device(pci) < 0) { 1399 + printk(KERN_ERR "hda-intel: pci_enable_device failed, " 1400 + "disabling device\n"); 1401 + snd_card_disconnect(card); 1402 + return -EIO; 1403 + } 1437 1404 pci_set_master(pci); 1405 + if (chip->msi) 1406 + if (pci_enable_msi(pci) < 0) 1407 + chip->msi = 0; 1408 + if (azx_acquire_irq(chip, 1) < 0) 1409 + return -EIO; 1438 1410 azx_init_chip(chip); 1439 1411 snd_hda_resume(chip->bus); 1440 1412 snd_power_change_state(card, SNDRV_CTL_POWER_D0); ··· 1469 1431 /* disable position buffer */ 1470 1432 azx_writel(chip, DPLBASE, 0); 1471 1433 azx_writel(chip, DPUBASE, 0); 1472 - 1473 - synchronize_irq(chip->irq); 1474 1434 } 1475 1435 1476 1436 if (chip->irq >= 0) { 1437 + synchronize_irq(chip->irq); 1477 1438 free_irq(chip->irq, (void*)chip); 1478 - if (!disable_msi) 1479 - pci_disable_msi(chip->pci); 1480 1439 } 1440 + if (chip->msi) 1441 + pci_disable_msi(chip->pci); 1481 1442 if (chip->remap_addr) 1482 1443 iounmap(chip->remap_addr); 1483 1444 ··· 1531 1494 chip->pci = pci; 1532 1495 chip->irq = -1; 1533 1496 chip->driver_type = driver_type; 1497 + chip->msi = !disable_msi; 1534 1498 1535 1499 chip->position_fix = position_fix; 1536 1500 chip->single_cmd = single_cmd; ··· 1561 1523 goto errout; 1562 1524 } 1563 1525 1564 - if (!disable_msi) 1565 - pci_enable_msi(pci); 1526 + if (chip->msi) 1527 + if (pci_enable_msi(pci) < 0) 1528 + chip->msi = 0; 1566 1529 1567 - if (request_irq(pci->irq, azx_interrupt, IRQF_DISABLED|IRQF_SHARED, 1568 - "HDA Intel", (void*)chip)) { 1569 - snd_printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq); 1530 + if (azx_acquire_irq(chip, 0) < 0) { 1570 1531 err = -EBUSY; 1571 1532 goto errout; 1572 1533 } 1573 - chip->irq = pci->irq; 1574 1534 1575 1535 pci_set_master(pci); 1576 1536 synchronize_irq(chip->irq); ··· 1713 1677 { 0x1002, 0x437b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB450 */ 1714 1678 { 0x1002, 0x4383, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATI }, /* ATI SB600 */ 1715 1679 { 0x1002, 0x793b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS600 HDMI */ 1680 + { 0x1002, 0x7919, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ATIHDMI }, /* ATI RS690 HDMI */ 1716 1681 { 0x1106, 0x3288, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_VIA }, /* VIA VT8251/VT8237A */ 1717 1682 { 0x1039, 0x7502, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_SIS }, /* SIS966 */ 1718 1683 { 0x10b9, 0x5461, PCI_ANY_ID, PCI_ANY_ID, 0, 0, AZX_DRIVER_ULI }, /* ULI M5461 */
+2
sound/pci/hda/patch_analog.c
··· 818 818 .config = AD1986A_LAPTOP_EAPD }, /* ASUS A6J */ 819 819 { .pci_subvendor = 0x1043, .pci_subdevice = 0x11f7, 820 820 .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5A */ 821 + { .pci_subvendor = 0x1043, .pci_subdevice = 0x1263, 822 + .config = AD1986A_LAPTOP_EAPD }, /* ASUS U5F */ 821 823 { .pci_subvendor = 0x1043, .pci_subdevice = 0x1297, 822 824 .config = AD1986A_LAPTOP_EAPD }, /* ASUS Z62F */ 823 825 { .pci_subvendor = 0x103c, .pci_subdevice = 0x30af,
+1
sound/pci/hda/patch_atihdmi.c
··· 161 161 */ 162 162 struct hda_codec_preset snd_hda_preset_atihdmi[] = { 163 163 { .id = 0x1002793c, .name = "ATI RS600 HDMI", .patch = patch_atihdmi }, 164 + { .id = 0x1002791a, .name = "ATI RS690 HDMI", .patch = patch_atihdmi }, 164 165 {} /* terminator */ 165 166 };
+2 -2
sound/pci/hda/patch_realtek.c
··· 1799 1799 /* SPDIF for stream index #1 */ 1800 1800 if (spec->multiout.dig_out_nid || spec->dig_in_nid) { 1801 1801 codec->num_pcms = 2; 1802 - info++; 1802 + info = spec->pcm_rec + 1; 1803 1803 info->name = spec->stream_name_digital; 1804 1804 if (spec->multiout.dig_out_nid && 1805 1805 spec->stream_digital_playback) { ··· 1820 1820 if (spec->num_adc_nids > 1 && spec->stream_analog_capture && 1821 1821 spec->adc_nids) { 1822 1822 codec->num_pcms = 3; 1823 - info++; 1823 + info = spec->pcm_rec + 2; 1824 1824 info->name = spec->stream_name_analog; 1825 1825 /* No playback stream for second PCM */ 1826 1826 info->stream[SNDRV_PCM_STREAM_PLAYBACK] = alc_pcm_null_playback;
+19 -4
sound/pci/intel8x0.c
··· 2476 2476 if (chip->device_type == DEVICE_INTEL_ICH4) 2477 2477 chip->sdm_saved = igetbyte(chip, ICHREG(SDM)); 2478 2478 2479 - if (chip->irq >= 0) 2479 + if (chip->irq >= 0) { 2480 + synchronize_irq(chip->irq); 2480 2481 free_irq(chip->irq, chip); 2482 + chip->irq = -1; 2483 + } 2481 2484 pci_disable_device(pci); 2482 2485 pci_save_state(pci); 2486 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2483 2487 return 0; 2484 2488 } 2485 2489 ··· 2493 2489 struct intel8x0 *chip = card->private_data; 2494 2490 int i; 2495 2491 2492 + pci_set_power_state(pci, PCI_D0); 2496 2493 pci_restore_state(pci); 2497 - pci_enable_device(pci); 2494 + if (pci_enable_device(pci) < 0) { 2495 + printk(KERN_ERR "intel8x0: pci_enable_device failed, " 2496 + "disabling device\n"); 2497 + snd_card_disconnect(card); 2498 + return -EIO; 2499 + } 2498 2500 pci_set_master(pci); 2499 - request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, 2500 - card->shortname, chip); 2501 + if (request_irq(pci->irq, snd_intel8x0_interrupt, 2502 + IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { 2503 + printk(KERN_ERR "intel8x0: unable to grab IRQ %d, " 2504 + "disabling device\n", pci->irq); 2505 + snd_card_disconnect(card); 2506 + return -EIO; 2507 + } 2501 2508 chip->irq = pci->irq; 2502 2509 synchronize_irq(chip->irq); 2503 2510 snd_intel8x0_chip_init(chip, 0);
+19 -4
sound/pci/intel8x0m.c
··· 1045 1045 for (i = 0; i < chip->pcm_devs; i++) 1046 1046 snd_pcm_suspend_all(chip->pcm[i]); 1047 1047 snd_ac97_suspend(chip->ac97); 1048 - if (chip->irq >= 0) 1048 + if (chip->irq >= 0) { 1049 + synchronize_irq(chip->irq); 1049 1050 free_irq(chip->irq, chip); 1051 + chip->irq = -1; 1052 + } 1050 1053 pci_disable_device(pci); 1051 1054 pci_save_state(pci); 1055 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1052 1056 return 0; 1053 1057 } 1054 1058 ··· 1061 1057 struct snd_card *card = pci_get_drvdata(pci); 1062 1058 struct intel8x0m *chip = card->private_data; 1063 1059 1060 + pci_set_power_state(pci, PCI_D0); 1064 1061 pci_restore_state(pci); 1065 - pci_enable_device(pci); 1062 + if (pci_enable_device(pci) < 0) { 1063 + printk(KERN_ERR "intel8x0m: pci_enable_device failed, " 1064 + "disabling device\n"); 1065 + snd_card_disconnect(card); 1066 + return -EIO; 1067 + } 1066 1068 pci_set_master(pci); 1067 - request_irq(pci->irq, snd_intel8x0_interrupt, IRQF_DISABLED|IRQF_SHARED, 1068 - card->shortname, chip); 1069 + if (request_irq(pci->irq, snd_intel8x0_interrupt, 1070 + IRQF_DISABLED|IRQF_SHARED, card->shortname, chip)) { 1071 + printk(KERN_ERR "intel8x0m: unable to grab IRQ %d, " 1072 + "disabling device\n", pci->irq); 1073 + snd_card_disconnect(card); 1074 + return -EIO; 1075 + } 1069 1076 chip->irq = pci->irq; 1070 1077 snd_intel8x0_chip_init(chip, 0); 1071 1078 snd_ac97_resume(chip->ac97);
+8 -5
sound/pci/maestro3.c
··· 2589 2589 chip->suspend_mem[index++] = 2590 2590 snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i); 2591 2591 2592 - /* power down apci registers */ 2593 - snd_m3_outw(chip, 0xffff, 0x54); 2594 - snd_m3_outw(chip, 0xffff, 0x56); 2595 - 2596 2592 pci_disable_device(pci); 2597 2593 pci_save_state(pci); 2594 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2598 2595 return 0; 2599 2596 } 2600 2597 ··· 2604 2607 if (chip->suspend_mem == NULL) 2605 2608 return 0; 2606 2609 2610 + pci_set_power_state(pci, PCI_D0); 2607 2611 pci_restore_state(pci); 2608 - pci_enable_device(pci); 2612 + if (pci_enable_device(pci) < 0) { 2613 + printk(KERN_ERR "maestor3: pci_enable_device failed, " 2614 + "disabling device\n"); 2615 + snd_card_disconnect(card); 2616 + return -EIO; 2617 + } 2609 2618 pci_set_master(pci); 2610 2619 2611 2620 /* first lets just bring everything back. .*/
+11 -1
sound/pci/nm256/nm256.c
··· 1390 1390 chip->coeffs_current = 0; 1391 1391 pci_disable_device(pci); 1392 1392 pci_save_state(pci); 1393 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1393 1394 return 0; 1394 1395 } 1395 1396 ··· 1402 1401 1403 1402 /* Perform a full reset on the hardware */ 1404 1403 chip->in_resume = 1; 1404 + 1405 + pci_set_power_state(pci, PCI_D0); 1405 1406 pci_restore_state(pci); 1406 - pci_enable_device(pci); 1407 + if (pci_enable_device(pci) < 0) { 1408 + printk(KERN_ERR "nm256: pci_enable_device failed, " 1409 + "disabling device\n"); 1410 + snd_card_disconnect(card); 1411 + return -EIO; 1412 + } 1413 + pci_set_master(pci); 1414 + 1407 1415 snd_nm256_init_chip(chip); 1408 1416 1409 1417 /* restore ac97 */
+8 -3
sound/pci/riptide/riptide.c
··· 1178 1178 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); 1179 1179 snd_pcm_suspend_all(chip->pcm); 1180 1180 snd_ac97_suspend(chip->ac97); 1181 - pci_set_power_state(pci, PCI_D3hot); 1182 1181 pci_disable_device(pci); 1183 1182 pci_save_state(pci); 1183 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1184 1184 return 0; 1185 1185 } 1186 1186 ··· 1189 1189 struct snd_card *card = pci_get_drvdata(pci); 1190 1190 struct snd_riptide *chip = card->private_data; 1191 1191 1192 - pci_restore_state(pci); 1193 - pci_enable_device(pci); 1194 1192 pci_set_power_state(pci, PCI_D0); 1193 + pci_restore_state(pci); 1194 + if (pci_enable_device(pci) < 0) { 1195 + printk(KERN_ERR "riptide: pci_enable_device failed, " 1196 + "disabling device\n"); 1197 + snd_card_disconnect(card); 1198 + return -EIO; 1199 + } 1195 1200 pci_set_master(pci); 1196 1201 snd_riptide_initialize(chip); 1197 1202 snd_ac97_resume(chip->ac97);
+9 -9
sound/pci/trident/trident_main.c
··· 3966 3966 snd_ac97_suspend(trident->ac97); 3967 3967 snd_ac97_suspend(trident->ac97_sec); 3968 3968 3969 - switch (trident->device) { 3970 - case TRIDENT_DEVICE_ID_DX: 3971 - case TRIDENT_DEVICE_ID_NX: 3972 - break; /* TODO */ 3973 - case TRIDENT_DEVICE_ID_SI7018: 3974 - break; 3975 - } 3976 3969 pci_disable_device(pci); 3977 3970 pci_save_state(pci); 3971 + pci_set_power_state(pci, pci_choose_state(pci, state)); 3978 3972 return 0; 3979 3973 } 3980 3974 ··· 3977 3983 struct snd_card *card = pci_get_drvdata(pci); 3978 3984 struct snd_trident *trident = card->private_data; 3979 3985 3986 + pci_set_power_state(pci, PCI_D0); 3980 3987 pci_restore_state(pci); 3981 - pci_enable_device(pci); 3982 - pci_set_master(pci); /* to be sure */ 3988 + if (pci_enable_device(pci) < 0) { 3989 + printk(KERN_ERR "trident: pci_enable_device failed, " 3990 + "disabling device\n"); 3991 + snd_card_disconnect(card); 3992 + return -EIO; 3993 + } 3994 + pci_set_master(pci); 3983 3995 3984 3996 switch (trident->device) { 3985 3997 case TRIDENT_DEVICE_ID_DX:
+9 -3
sound/pci/via82xx.c
··· 2185 2185 chip->capture_src_saved[1] = inb(chip->port + VIA_REG_CAPTURE_CHANNEL + 0x10); 2186 2186 } 2187 2187 2188 - pci_set_power_state(pci, PCI_D3hot); 2189 2188 pci_disable_device(pci); 2190 2189 pci_save_state(pci); 2190 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2191 2191 return 0; 2192 2192 } 2193 2193 ··· 2197 2197 struct via82xx *chip = card->private_data; 2198 2198 int i; 2199 2199 2200 - pci_restore_state(pci); 2201 - pci_enable_device(pci); 2202 2200 pci_set_power_state(pci, PCI_D0); 2201 + pci_restore_state(pci); 2202 + if (pci_enable_device(pci) < 0) { 2203 + printk(KERN_ERR "via82xx: pci_enable_device failed, " 2204 + "disabling device\n"); 2205 + snd_card_disconnect(card); 2206 + return -EIO; 2207 + } 2208 + pci_set_master(pci); 2203 2209 2204 2210 snd_via82xx_chip_init(chip); 2205 2211
+9 -3
sound/pci/via82xx_modem.c
··· 1032 1032 snd_via82xx_channel_reset(chip, &chip->devs[i]); 1033 1033 synchronize_irq(chip->irq); 1034 1034 snd_ac97_suspend(chip->ac97); 1035 - pci_set_power_state(pci, PCI_D3hot); 1035 + 1036 1036 pci_disable_device(pci); 1037 1037 pci_save_state(pci); 1038 + pci_set_power_state(pci, pci_choose_state(pci, state)); 1038 1039 return 0; 1039 1040 } 1040 1041 ··· 1045 1044 struct via82xx_modem *chip = card->private_data; 1046 1045 int i; 1047 1046 1048 - pci_restore_state(pci); 1049 - pci_enable_device(pci); 1050 1047 pci_set_power_state(pci, PCI_D0); 1048 + pci_restore_state(pci); 1049 + if (pci_enable_device(pci) < 0) { 1050 + printk(KERN_ERR "via82xx-modem: pci_enable_device failed, " 1051 + "disabling device\n"); 1052 + snd_card_disconnect(card); 1053 + return -EIO; 1054 + } 1051 1055 pci_set_master(pci); 1052 1056 1053 1057 snd_via82xx_chip_init(chip);
+8 -3
sound/pci/vx222/vx222.c
··· 266 266 int err; 267 267 268 268 err = snd_vx_suspend(&vx->core, state); 269 - pci_set_power_state(pci, PCI_D3hot); 270 269 pci_disable_device(pci); 271 270 pci_save_state(pci); 271 + pci_set_power_state(pci, pci_choose_state(pci, state)); 272 272 return err; 273 273 } 274 274 ··· 277 277 struct snd_card *card = pci_get_drvdata(pci); 278 278 struct snd_vx222 *vx = card->private_data; 279 279 280 - pci_restore_state(pci); 281 - pci_enable_device(pci); 282 280 pci_set_power_state(pci, PCI_D0); 281 + pci_restore_state(pci); 282 + if (pci_enable_device(pci) < 0) { 283 + printk(KERN_ERR "vx222: pci_enable_device failed, " 284 + "disabling device\n"); 285 + snd_card_disconnect(card); 286 + return -EIO; 287 + } 283 288 pci_set_master(pci); 284 289 return snd_vx_resume(&vx->core); 285 290 }
+8 -1
sound/pci/ymfpci/ymfpci_main.c
··· 2218 2218 snd_ymfpci_disable_dsp(chip); 2219 2219 pci_disable_device(pci); 2220 2220 pci_save_state(pci); 2221 + pci_set_power_state(pci, pci_choose_state(pci, state)); 2221 2222 return 0; 2222 2223 } 2223 2224 ··· 2228 2227 struct snd_ymfpci *chip = card->private_data; 2229 2228 unsigned int i; 2230 2229 2230 + pci_set_power_state(pci, PCI_D0); 2231 2231 pci_restore_state(pci); 2232 - pci_enable_device(pci); 2232 + if (pci_enable_device(pci) < 0) { 2233 + printk(KERN_ERR "ymfpci: pci_enable_device failed, " 2234 + "disabling device\n"); 2235 + snd_card_disconnect(card); 2236 + return -EIO; 2237 + } 2233 2238 pci_set_master(pci); 2234 2239 snd_ymfpci_aclink_reset(pci); 2235 2240 snd_ymfpci_codec_ready(chip, 0);