--- zzzz-none-000/linux-3.10.107/sound/pci/sis7019.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/sis7019.c 2021-02-04 17:41:59.000000000 +0000 @@ -52,7 +52,7 @@ module_param(codecs, int, 0444); MODULE_PARM_DESC(codecs, "Set bit to indicate that codec number is expected to be present (default 1)"); -static DEFINE_PCI_DEVICE_TABLE(snd_sis7019_ids) = { +static const struct pci_device_id snd_sis7019_ids[] = { { PCI_DEVICE(PCI_VENDOR_ID_SI, 0x7019) }, { 0, } }; @@ -383,9 +383,9 @@ { /* Helper function: must hold sis->voice_lock on entry */ if (!sis->silence_users) - sis->silence_dma_addr = pci_map_single(sis->pci, + sis->silence_dma_addr = dma_map_single(&sis->pci->dev, sis->suspend_state[0], - 4096, PCI_DMA_TODEVICE); + 4096, DMA_TO_DEVICE); sis->silence_users++; } @@ -394,8 +394,8 @@ /* Helper function: must hold sis->voice_lock on entry */ sis->silence_users--; if (!sis->silence_users) - pci_unmap_single(sis->pci, sis->silence_dma_addr, 4096, - PCI_DMA_TODEVICE); + dma_unmap_single(&sis->pci->dev, sis->silence_dma_addr, 4096, + DMA_TO_DEVICE); } static void sis_free_voice(struct sis7019 *sis, struct voice *voice) @@ -1064,12 +1064,9 @@ if (sis->irq >= 0) free_irq(sis->irq, sis); - if (sis->ioaddr) - iounmap(sis->ioaddr); - + iounmap(sis->ioaddr); pci_release_regions(sis->pci); pci_disable_device(sis->pci); - sis_free_suspend(sis); return 0; } @@ -1211,7 +1208,6 @@ #ifdef CONFIG_PM_SLEEP static int sis_suspend(struct device *dev) { - struct pci_dev *pci = to_pci_dev(dev); struct snd_card *card = dev_get_drvdata(dev); struct sis7019 *sis = card->private_data; void __iomem *ioaddr = sis->ioaddr; @@ -1240,9 +1236,6 @@ ioaddr += 4096; } - pci_disable_device(pci); - pci_save_state(pci); - pci_set_power_state(pci, PCI_D3hot); return 0; } @@ -1254,14 +1247,6 @@ void __iomem *ioaddr = sis->ioaddr; int i; - pci_set_power_state(pci, PCI_D0); - pci_restore_state(pci); - - if (pci_enable_device(pci) < 0) { - dev_err(&pci->dev, "unable to re-enable device\n"); - goto error; - } - if (sis_chip_init(sis)) { dev_err(&pci->dev, "unable to re-init controller\n"); goto error; @@ -1284,7 +1269,6 @@ memset(sis->suspend_state[0], 0, 4096); sis->irq = pci->irq; - pci_set_master(pci); if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT) snd_ac97_resume(sis->ac97[0]); @@ -1341,7 +1325,7 @@ if (rc) goto error_out; - rc = pci_set_dma_mask(pci, DMA_BIT_MASK(30)); + rc = dma_set_mask(&pci->dev, DMA_BIT_MASK(30)); if (rc < 0) { dev_err(&pci->dev, "architecture does not support 30-bit PCI busmaster DMA"); goto error_out_enabled; @@ -1404,8 +1388,6 @@ if (rc) goto error_out_cleanup; - snd_card_set_dev(card, &pci->dev); - return 0; error_out_cleanup: @@ -1440,7 +1422,8 @@ if (!codecs) codecs = SIS_PRIMARY_CODEC_PRESENT; - rc = snd_card_create(index, id, THIS_MODULE, sizeof(*sis), &card); + rc = snd_card_new(&pci->dev, index, id, THIS_MODULE, + sizeof(*sis), &card); if (rc < 0) goto error_out; @@ -1482,7 +1465,6 @@ static void snd_sis7019_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); - pci_set_drvdata(pci, NULL); } static struct pci_driver sis7019_driver = {