linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PATCH: emu10k1 moving pci_enable_device
@ 2001-05-02  6:44 Marcus Meissner
  0 siblings, 0 replies; only message in thread
From: Marcus Meissner @ 2001-05-02  6:44 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Hi,

This moves pci_enable_device in emu10k1 driver before any resource
access.

Ciao, Marcus

Index: main.c
===================================================================
RCS file: /build/mm/work/repository/linux-mm/drivers/sound/emu10k1/main.c,v
retrieving revision 1.3
diff -u -r1.3 linux-mm/drivers/sound/emu10k1/main.c
--- linux-vanilla/drivers/sound/emu10k1/main.c	2001/04/17 16:55:42	1.3
+++ linux-mm/drivers/sound/emu10k1/main.c	2001/04/25 11:25:02
@@ -612,7 +612,11 @@
 {
 	struct emu10k1_card *card;
 	u32 subsysvid;
+	int ret;
 
+	if ((ret=pci_enable_device(pci_dev)))
+		return ret;
+
 	if ((card = kmalloc(sizeof(struct emu10k1_card), GFP_KERNEL)) == NULL) {
 		printk(KERN_ERR "emu10k1: out of memory\n");
 		return -ENOMEM;
@@ -621,11 +625,6 @@
 
 	if (pci_set_dma_mask(pci_dev, EMU10K1_DMA_MASK)) {
 		printk(KERN_ERR "emu10k1: architecture does not support 32bit PCI busmaster DMA\n");
-		kfree(card);
-		return -ENODEV;
-	}
-
-	if (pci_enable_device(pci_dev)) {
 		kfree(card);
 		return -ENODEV;
 	}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-02  6:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-02  6:44 PATCH: emu10k1 moving pci_enable_device Marcus Meissner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).