
From: Bjorn Helgaas <bjorn.helgaas@hp.com>

Thanks to Paul Blazejowski for reporting a boot-time panic and verifying
that this patch fixes it.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/scsi/iteraid.c |    5 +++++
 25-akpm/drivers/scsi/iteraid.h |    4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/iteraid.c~iteraid-pci_enable_device-for-irq-routing drivers/scsi/iteraid.c
--- 25/drivers/scsi/iteraid.c~iteraid-pci_enable_device-for-irq-routing	2004-08-15 15:27:38.589389344 -0700
+++ 25-akpm/drivers/scsi/iteraid.c	2004-08-15 15:27:38.600387672 -0700
@@ -4901,12 +4901,16 @@ static int iteraid_detect(Scsi_Host_Temp
 		if (PCI_FUNC(pPciDev->devfn))
 			continue;
 
+		if (pci_enable_device(pPciDev))
+			continue;
+
 		/*
 		 * Allocate memory for Adapter.
 		 */
 		pAdap = (PITE_ADAPTER) kmalloc(sizeof(ITE_ADAPTER), GFP_ATOMIC);
 		if (pAdap == NULL) {
 			printk("iteraid_detect: pAdap allocate failed.\n");
+			pci_disable_device(pPciDev);
 			continue;
 		}
 		memset(pAdap, 0, sizeof(ITE_ADAPTER));
@@ -5016,6 +5020,7 @@ static int iteraid_release(struct Scsi_H
 		if (pAdap->IDEChannel != NULL) {
 			kfree(pAdap->IDEChannel);
 		}
+		pci_disable_device(pAdap->pci_dev);
 		if (pAdap != NULL) {
 			kfree(pAdap);
 		}
diff -puN drivers/scsi/iteraid.h~iteraid-pci_enable_device-for-irq-routing drivers/scsi/iteraid.h
--- 25/drivers/scsi/iteraid.h~iteraid-pci_enable_device-for-irq-routing	2004-08-15 15:27:38.591389040 -0700
+++ 25-akpm/drivers/scsi/iteraid.h	2004-08-15 15:27:38.596388280 -0700
@@ -1203,8 +1203,8 @@ typedef struct _Channel {
 typedef struct _Adapter {
 	char *name;		/* Adapter's name               */
 	u8 num_channels;	/* How many channels support    */
-	u8 irq;			/* irq number                   */
-	u8 irqOwned;		/* If any irq is use            */
+	unsigned int irq;	/* irq number                   */
+	unsigned int irqOwned;	/* If any irq is use            */
 	u8 pci_bus;		/* PCI bus number               */
 	u8 devfn;		/* Device and function number   */
 	u8 offline;		/* On line or off line          */
_
