patch-2.3.47 linux/drivers/sound/sonicvibes.c

Next file: linux/drivers/usb/Makefile
Previous file: linux/drivers/sound/sb_card.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/drivers/sound/sonicvibes.c linux/drivers/sound/sonicvibes.c
@@ -2447,6 +2447,10 @@
 		return -1;
 	if (pcidev->irq == 0)
 		return -1;
+	if (!pci_dma_supported(pcidev, 0x00ffffff)) {
+		printk(KERN_WARNING "sonicvibes: architecture does not support 24bit PCI busmaster DMA\n");
+		return -1;
+	}
 	/* try to allocate a DDMA resource if not already available */
 	if (!RSRCISIOREGION(pcidev, RESOURCE_DDMA)) {
 		pcidev->resource[RESOURCE_DDMA].start = 0;
@@ -2625,7 +2629,7 @@
        dev->driver_data = NULL;
 }
 
-static const struct pci_device_id id_table[] __devinitdata = {
+static struct pci_device_id id_table[] __devinitdata = {
        { PCI_VENDOR_ID_S3, PCI_DEVICE_ID_S3_SONICVIBES, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
        { 0, 0, 0, 0, 0, 0 }
 };
@@ -2648,8 +2652,10 @@
 	if (!(wavetable_mem = __get_free_pages(GFP_KERNEL, 20-PAGE_SHIFT)))
 		printk(KERN_INFO "sv: cannot allocate 1MB of contiguous nonpageable memory for wavetable data\n");
 #endif
-	if (!pci_register_driver(&sv_driver))
+	if (!pci_register_driver(&sv_driver)) {
+		pci_unregister_driver(&sv_driver);
                 return -ENODEV;
+	}
         return 0;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)