Re: [PATCH 1/2] usb: change the dependency chain for LPC32XX and ISP1301

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/22/2012 09:49 PM, Alan Stern wrote:
diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index c3f619b..cac3ee2 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -292,7 +292,6 @@ config USB_OHCI_HCD
  	depends on USB&&  USB_ARCH_HAS_OHCI
  	select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3
  	select USB_OTG_UTILS if ARCH_OMAP
-	select USB_ISP1301 if ARCH_LPC32XX || ARCH_PNX4008

You want to avoid selecting USB_ISP1301, right?

Yes. "depends on USB_ISP1301 if ARCH_LPC32XX" does not work.

@@ -412,6 +411,15 @@ config USB_CNS3XXX_OHCI
  	  Enable support for the CNS3XXX SOC's on-chip OHCI controller.
  	  It is needed for low-speed USB 1.0 device support.

+config USB_OHCI_LPC32XX_PNX4008
+	bool "LPC32XX or PNX4008 OHCI Module"
+	depends on USB_OHCI_HCD
+	depends on USB_ISP1301
+	---help---
+	  Enable support for the LPC32XX or PNX4008 SOC's on-chip
+	  OHCI controller.
+	  It is needed for low-speed USB 1.0 device support.

Instead you introduce a new symbol to control whether or not ohci-nxp.c
gets compiled.  The new symbol depends on USB_ISP1301 but not on
ARCH_LPC32XX or ARCH_PNX4008, which means in theory it could be defined
even under a totally different arch.

In theory, yes.

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 2b1e8d8..95cb858 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1049,7 +1049,7 @@ MODULE_LICENSE ("GPL");
  #define PLATFORM_DRIVER		ohci_hcd_at91_driver
  #endif

-#if defined(CONFIG_ARCH_PNX4008) || defined(CONFIG_ARCH_LPC32XX)
+#ifdef USB_OHCI_LPC32XX_PNX4008

	(... should be CONFIG_USB_OHCI_LPC32XX_PNX4008)

  #include "ohci-nxp.c"
  #define PLATFORM_DRIVER		usb_hcd_nxp_driver
  #endif

And then you compile ohci-nxp.c whenever the new symbol is defined.

Is this really what you want?  It doesn't seem right.  Couldn't it lead
to a conflict if USB_OHCI_LPC32XX_PNX4008 is defined under the wrong
arch?

Yes. I overlooked this. If the I2C phy is limited to the ARCH then it
should be okay.

Also, why do you want the new symbol to be configurable whereas now
everything is decided automatically?  Couldn't you get the effect you
want without the new symbol, like this:

-#if defined(CONFIG_ARCH_PNX4008) || defined(CONFIG_ARCH_LPC32XX)
+#if (defined(CONFIG_ARCH_PNX4008) || defined(CONFIG_ARCH_LPC32XX))&&  \
	defined(CONFIG_USB_ISP1301)

?

That would work.

Alan Stern

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux