patch-2.3.51 linux/drivers/usb/usb-ohci.c

Next file: linux/drivers/usb/usb-serial.c
Previous file: linux/drivers/usb/usb-debug.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.50/linux/drivers/usb/usb-ohci.c linux/drivers/usb/usb-ohci.c
@@ -41,16 +41,16 @@
 #include <linux/timer.h>
 #include <linux/list.h>
 #include <linux/interrupt.h>  /* for in_interrupt() */
+#undef DEBUG
+#include <linux/usb.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/system.h>
 #include <asm/unaligned.h>
 
-#undef DEBUG
 #define OHCI_USE_NPS
 
-#include "usb.h"
 #include "usb-ohci.h"
 
 #include <linux/pm.h>
@@ -1675,20 +1675,24 @@
  
 static int hc_start_ohci (struct pci_dev * dev)
 {
-	u32 cmd;
+	unsigned long mem_base;
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-	unsigned long mem_base = dev->resource[0].start;
+	mem_base = dev->resource[0].start;
+	if (pci_enable_device(dev) < 0)
+		return -ENODEV;
 #else
-	unsigned long mem_base = dev->base_address[0];
+	u16 cmd;
+
+	mem_base = dev->base_address[0];
 	if (mem_base & PCI_BASE_ADDRESS_SPACE_IO) return -ENODEV;
 	mem_base &= PCI_BASE_ADDRESS_MEM_MASK;
+
+	/* Some Mac firmware will switch memory response off */
+	pci_read_config_word(dev, PCI_COMMAND, &cmd);
+	pci_write_config_word(dev, PCI_COMMAND, cmd | PCI_COMMAND_MEMORY);
 #endif
 	
-	/* Some Mac firmware will switch memory response off */
-	pci_read_config_dword(dev, PCI_COMMAND, &cmd);
-	cmd = (cmd | PCI_COMMAND_MEMORY);
-	pci_write_config_dword(dev, PCI_COMMAND, cmd);
-
 	pci_set_master (dev);
 	mem_base = (unsigned long) ioremap_nocache (mem_base, 4096);
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)