public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcus Meissner <Marcus.Meissner@caldera.de>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: PATCH: emu10k1 moving pci_enable_device
Date: Wed, 2 May 2001 08:44:25 +0200	[thread overview]
Message-ID: <20010502084425.A19594@caldera.de> (raw)

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;
 	}

                 reply	other threads:[~2001-05-02  6:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010502084425.A19594@caldera.de \
    --to=marcus.meissner@caldera.de \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox