Re: PATCH: trident , pci_enable_device moved

Marcus Meissner (Marcus.Meissner@caldera.de)
Wed, 25 Apr 2001 13:06:24 +0200


On Wed, Apr 25, 2001 at 09:04:38AM +0200, Marcus Meissner wrote:
> Hi Alan, linux-kernel,
>
> This moves pci_enable_device() in trident.c before any PCI resource access.
> Everything else appears to be ok in regards to 2.4 PCI API and return values.
>
> Ciao, Marcus

Argh, actually the return value of pci_enable_device*() should be returned.

Ciao, Marcus

Index: drivers/sound/trident.c
===================================================================
RCS file: /build/mm/work/repository/linux-mm/drivers/sound/trident.c,v
retrieving revision 1.12
diff -u -r1.12 trident.c
--- drivers/sound/trident.c 2001/04/24 09:47:13 1.12
+++ drivers/sound/trident.c 2001/04/25 07:31:11
@@ -3308,7 +3308,11 @@
unsigned long iobase;
struct trident_card *card;
u8 revision;
+ int ret;

+ if ((ret=pci_enable_device(pci_dev)))
+ return ret;
+
if (pci_set_dma_mask(pci_dev, TRIDENT_DMA_MASK)) {
printk(KERN_ERR "trident: architecture does not support"
" 30bit PCI busmaster DMA\n");
@@ -3322,9 +3326,6 @@
iobase);
return -ENODEV;
}
-
- if (pci_enable_device(pci_dev))
- return -ENODEV;

if ((card = kmalloc(sizeof(struct trident_card), GFP_KERNEL)) == NULL) {
printk(KERN_ERR "trident: out of memory\n");
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/