diff options
Diffstat (limited to 'sound/pci/cs46xx/cs46xx_lib.c')
-rw-r--r-- | sound/pci/cs46xx/cs46xx_lib.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c index 4b052158ee33..6e3855b8b33d 100644 --- a/sound/pci/cs46xx/cs46xx_lib.c +++ b/sound/pci/cs46xx/cs46xx_lib.c | |||
@@ -1304,7 +1304,7 @@ static int _cs46xx_playback_open_channel (snd_pcm_substream_t * substream,int pc | |||
1304 | cs46xx_pcm_t * cpcm; | 1304 | cs46xx_pcm_t * cpcm; |
1305 | snd_pcm_runtime_t *runtime = substream->runtime; | 1305 | snd_pcm_runtime_t *runtime = substream->runtime; |
1306 | 1306 | ||
1307 | cpcm = kcalloc(1, sizeof(*cpcm), GFP_KERNEL); | 1307 | cpcm = kzalloc(sizeof(*cpcm), GFP_KERNEL); |
1308 | if (cpcm == NULL) | 1308 | if (cpcm == NULL) |
1309 | return -ENOMEM; | 1309 | return -ENOMEM; |
1310 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), | 1310 | if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci), |
@@ -3525,17 +3525,6 @@ static void amp_voyetra_4294(cs46xx_t *chip, int change) | |||
3525 | 3525 | ||
3526 | 3526 | ||
3527 | /* | 3527 | /* |
3528 | * piix4 pci ids | ||
3529 | */ | ||
3530 | #ifndef PCI_VENDOR_ID_INTEL | ||
3531 | #define PCI_VENDOR_ID_INTEL 0x8086 | ||
3532 | #endif /* PCI_VENDOR_ID_INTEL */ | ||
3533 | |||
3534 | #ifndef PCI_DEVICE_ID_INTEL_82371AB_3 | ||
3535 | #define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 | ||
3536 | #endif /* PCI_DEVICE_ID_INTEL_82371AB_3 */ | ||
3537 | |||
3538 | /* | ||
3539 | * Handle the CLKRUN on a thinkpad. We must disable CLKRUN support | 3528 | * Handle the CLKRUN on a thinkpad. We must disable CLKRUN support |
3540 | * whenever we need to beat on the chip. | 3529 | * whenever we need to beat on the chip. |
3541 | * | 3530 | * |
@@ -3548,7 +3537,7 @@ static void clkrun_hack(cs46xx_t *chip, int change) | |||
3548 | { | 3537 | { |
3549 | u16 control, nval; | 3538 | u16 control, nval; |
3550 | 3539 | ||
3551 | if (chip->acpi_dev == NULL) | 3540 | if (!chip->acpi_port) |
3552 | return; | 3541 | return; |
3553 | 3542 | ||
3554 | chip->amplifier += change; | 3543 | chip->amplifier += change; |
@@ -3571,15 +3560,20 @@ static void clkrun_hack(cs46xx_t *chip, int change) | |||
3571 | */ | 3560 | */ |
3572 | static void clkrun_init(cs46xx_t *chip) | 3561 | static void clkrun_init(cs46xx_t *chip) |
3573 | { | 3562 | { |
3563 | struct pci_dev *pdev; | ||
3574 | u8 pp; | 3564 | u8 pp; |
3575 | 3565 | ||
3576 | chip->acpi_dev = pci_find_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, NULL); | 3566 | chip->acpi_port = 0; |
3577 | if (chip->acpi_dev == NULL) | 3567 | |
3568 | pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | ||
3569 | PCI_DEVICE_ID_INTEL_82371AB_3, NULL); | ||
3570 | if (pdev == NULL) | ||
3578 | return; /* Not a thinkpad thats for sure */ | 3571 | return; /* Not a thinkpad thats for sure */ |
3579 | 3572 | ||
3580 | /* Find the control port */ | 3573 | /* Find the control port */ |
3581 | pci_read_config_byte(chip->acpi_dev, 0x41, &pp); | 3574 | pci_read_config_byte(pdev, 0x41, &pp); |
3582 | chip->acpi_port = pp << 8; | 3575 | chip->acpi_port = pp << 8; |
3576 | pci_dev_put(pdev); | ||
3583 | } | 3577 | } |
3584 | 3578 | ||
3585 | 3579 | ||
@@ -3780,7 +3774,7 @@ int __devinit snd_cs46xx_create(snd_card_t * card, | |||
3780 | if ((err = pci_enable_device(pci)) < 0) | 3774 | if ((err = pci_enable_device(pci)) < 0) |
3781 | return err; | 3775 | return err; |
3782 | 3776 | ||
3783 | chip = kcalloc(1, sizeof(*chip), GFP_KERNEL); | 3777 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
3784 | if (chip == NULL) { | 3778 | if (chip == NULL) { |
3785 | pci_disable_device(pci); | 3779 | pci_disable_device(pci); |
3786 | return -ENOMEM; | 3780 | return -ENOMEM; |