--- zzzz-none-000/linux-3.10.107/sound/pci/au88x0/au88x0.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/pci/au88x0/au88x0.c 2021-02-04 17:41:59.000000000 +0000 @@ -48,11 +48,10 @@ { int rc; if (!(rc = pci_write_config_byte(vortex, 0x40, 0xff))) { - printk(KERN_INFO CARD_NAME - ": vortex latency is 0xff\n"); + dev_info(&vortex->dev, "vortex latency is 0xff\n"); } else { - printk(KERN_WARNING CARD_NAME - ": could not set vortex latency: pci error 0x%x\n", rc); + dev_warn(&vortex->dev, + "could not set vortex latency: pci error 0x%x\n", rc); } } @@ -70,11 +69,10 @@ if (!(rc = pci_read_config_byte(via, 0x42, &value)) && ((value & 0x10) || !(rc = pci_write_config_byte(via, 0x42, value | 0x10)))) { - printk(KERN_INFO CARD_NAME - ": bridge config is 0x%x\n", value | 0x10); + dev_info(&via->dev, "bridge config is 0x%x\n", value | 0x10); } else { - printk(KERN_WARNING CARD_NAME - ": could not set vortex latency: pci error 0x%x\n", rc); + dev_warn(&via->dev, + "could not set vortex latency: pci error 0x%x\n", rc); } } @@ -97,7 +95,8 @@ PCI_DEVICE_ID_AMD_FE_GATE_7007, NULL); } if (via) { - printk(KERN_INFO CARD_NAME ": Activating latency workaround...\n"); + dev_info(&vortex->dev, + "Activating latency workaround...\n"); vortex_fix_latency(vortex); vortex_fix_agp_bridge(via); } @@ -151,9 +150,9 @@ // check PCI availability (DMA). if ((err = pci_enable_device(pci)) < 0) return err; - if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) < 0 || - pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) < 0) { - printk(KERN_ERR "error to set DMA mask\n"); + if (dma_set_mask(&pci->dev, DMA_BIT_MASK(32)) < 0 || + dma_set_coherent_mask(&pci->dev, DMA_BIT_MASK(32)) < 0) { + dev_err(card->dev, "error to set DMA mask\n"); pci_disable_device(pci); return -ENXIO; } @@ -182,7 +181,7 @@ chip->mmio = pci_ioremap_bar(pci, 0); if (!chip->mmio) { - printk(KERN_ERR "MMIO area remap failed.\n"); + dev_err(card->dev, "MMIO area remap failed.\n"); err = -ENOMEM; goto ioremap_out; } @@ -191,14 +190,14 @@ * This must be done before we do request_irq otherwise we can get spurious * interrupts that we do not handle properly and make a mess of things */ if ((err = vortex_core_init(chip)) != 0) { - printk(KERN_ERR "hw core init failed\n"); + dev_err(card->dev, "hw core init failed\n"); goto core_out; } if ((err = request_irq(pci->irq, vortex_interrupt, IRQF_SHARED, KBUILD_MODNAME, chip)) != 0) { - printk(KERN_ERR "cannot grab irq\n"); + dev_err(card->dev, "cannot grab irq\n"); goto irq_out; } chip->irq = pci->irq; @@ -211,8 +210,6 @@ goto alloc_out; } - snd_card_set_dev(card, &pci->dev); - *rchip = chip; return 0; @@ -250,7 +247,8 @@ return -ENOENT; } // (2) - err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card); + err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, + 0, &card); if (err < 0) return err; @@ -316,7 +314,7 @@ if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_VORTEX_SYNTH, sizeof(snd_vortex_synth_arg_t), &wave) < 0 || wave == NULL) { - snd_printk(KERN_ERR "Can't initialize Aureal wavetable synth\n"); + dev_err(card->dev, "Can't initialize Aureal wavetable synth\n"); } else { snd_vortex_synth_arg_t *arg; @@ -343,11 +341,11 @@ chip->rev = pci->revision; #ifdef CHIP_AU8830 if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) { - printk(KERN_ALERT - "vortex: The revision (%x) of your card has not been seen before.\n", + dev_alert(card->dev, + "The revision (%x) of your card has not been seen before.\n", chip->rev); - printk(KERN_ALERT - "vortex: Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n"); + dev_alert(card->dev, + "Please email the results of 'lspci -vv' to openvortex-dev@nongnu.org.\n"); snd_card_free(card); err = -ENODEV; return err; @@ -371,7 +369,6 @@ static void snd_vortex_remove(struct pci_dev *pci) { snd_card_free(pci_get_drvdata(pci)); - pci_set_drvdata(pci, NULL); } // pci_driver definition