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

Next file: linux/drivers/sound/es1371.c
Previous file: linux/drivers/sound/ac97_codec.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/drivers/sound/es1370.c linux/drivers/sound/es1370.c
@@ -2466,6 +2466,10 @@
 		return -1;
 	if (pcidev->irq == 0) 
 		return -1;
+	if (!pci_dma_supported(pcidev, 0xffffffff)) {
+		printk(KERN_WARNING "es1370: architecture does not support 32bit PCI busmaster DMA\n");
+		return -1;
+	}
 	if (!(s = kmalloc(sizeof(struct es1370_state), GFP_KERNEL))) {
 		printk(KERN_WARNING "es1370: out of memory\n");
 		return -1;
@@ -2589,7 +2593,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_ENSONIQ, PCI_DEVICE_ID_ENSONIQ_ES1370, PCI_ANY_ID, PCI_ANY_ID, 0, 0 },
 	{ 0, 0, 0, 0, 0, 0 }
 };
@@ -2608,8 +2612,10 @@
 	if (!pci_present())   /* No PCI bus in this machine! */
 		return -ENODEV;
 	printk(KERN_INFO "es1370: version v0.33 time " __TIME__ " " __DATE__ "\n");
-	if (!pci_register_driver(&es1370_driver))
+	if (!pci_register_driver(&es1370_driver)) {
+		pci_unregister_driver(&es1370_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)