public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB BIOS early handoff only when the we the driver is configured
@ 2007-07-31  8:31 David Engraf
  2007-07-31 15:04 ` [linux-usb-devel] " Alan Stern
  0 siblings, 1 reply; 14+ messages in thread
From: David Engraf @ 2007-07-31  8:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-pci, gregkh, linux-usb-devel, david.engraf

When CONFIG_USB_UHCI_HCD, CONFIG_USB_OHCI_HCD or CONFIG_USB_EHCI_HCD is
not configured we don't need to call the quirk_usb_handoff_xxxx function
in driver/usb/host/pci_quiks.c.

I think the kernel shouldn't take the control over the usb controller
when we don't have the driver for it,
so with this patch the kernel takes the control only when the driver is
configured.


linux-2.6.22.1

diff -puN drivers/usb/host/pci-quirks_orig.c drivers/usb/host/pci-quirks.c
--- drivers/usb/host/pci-quirks_orig.c    2007-07-10 20:56:30.000000000
+0200
+++ drivers/usb/host/pci-quirks.c    2007-07-31 09:55:28.000000000 +0200
@@ -142,6 +142,7 @@ static inline int io_type_enabled(struct
 #define pio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_IO)
 #define mmio_enabled(dev) io_type_enabled(dev, PCI_COMMAND_MEMORY)
 
+#ifdef CONFIG_USB_UHCI_HCD
 static void __devinit quirk_usb_handoff_uhci(struct pci_dev *pdev)
 {
     unsigned long base = 0;
@@ -159,12 +160,14 @@ static void __devinit quirk_usb_handoff_
     if (base)
         uhci_check_and_reset_hc(pdev, base);
 }
+#endif
 
 static int __devinit mmio_resource_enabled(struct pci_dev *pdev, int idx)
 {
     return pci_resource_start(pdev, idx) && mmio_enabled(pdev);
 }
 
+#ifdef CONFIG_USB_OHCI_HCD
 static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
 {
     void __iomem *base;
@@ -209,7 +212,9 @@ static void __devinit quirk_usb_handoff_
 
     iounmap(base);
 }
+#endif
 
+#ifdef CONFIG_USB_EHCI_HCD
 static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
 {
     int wait_time, delta;
@@ -346,16 +351,24 @@ static void __devinit quirk_usb_disable_
 
     return;
 }
-
+#endif
 
 
 static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
 {
+#ifdef CONFIG_USB_UHCI_HCD
     if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
         quirk_usb_handoff_uhci(pdev);
-    else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
+#endif
+
+#ifdef CONFIG_USB_OHCI_HCD
+    if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
         quirk_usb_handoff_ohci(pdev);
-    else if (pdev->class == PCI_CLASS_SERIAL_USB_EHCI)
+#endif
+
+#ifdef CONFIG_USB_EHCI_HCD
+    if (pdev->class == PCI_CLASS_SERIAL_USB_EHCI)
         quirk_usb_disable_ehci(pdev);
+#endif
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);


Thanks

David Engraf

 

 
Netcom Sicherheitstechnik GmbH
Rheinallee 189
55120 Mainz
Tel: 	+49 6131 6305 0
Fax: 	+49 6131 6305 40
Email: 	david.engraf@netcom.eu

 
Sitz der Gesellschaft: Mainz
Registergericht: Amtsgericht Mainz, 14HRB3411
Geschäftsführer: Peter Otto


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-08-07 14:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31  8:31 [PATCH] USB BIOS early handoff only when the we the driver is configured David Engraf
2007-07-31 15:04 ` [linux-usb-devel] " Alan Stern
     [not found]   ` <46B03078.5040305@netcom.eu>
2007-08-01  7:21     ` David Engraf
2007-08-01 20:23       ` Greg KH
2007-08-02  7:07         ` David Engraf
2007-08-01 14:40     ` Alan Stern
2007-08-02  7:14       ` David Engraf
2007-08-02 14:32         ` Alan Stern
2007-08-02 16:43           ` Greg KH
2007-08-03  6:52             ` David Engraf
2007-08-03 15:03               ` Alan Stern
2007-08-07  8:44                 ` David Engraf
2007-08-07 14:37                   ` Alan Stern
2007-08-03 22:24             ` Grant Grundler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox