Blob Blame History Raw
From: Jeff Mahoney <jeffm@suse.com>
Subject: chipidea: Allow user to select PCI/IMX options
Patch-mainline: Submitted to LKML Aug 27 2012

The chipidea driver currently has needless ifneq rules in the makefile
for things that should be config options. This can be problematic,
especially in the IMX case, since the OF dependency will be met
on powerpc systems - which don't actually support the hardware via that
method.

This patch adds _PCI and _IMX config options to allow the user to
select whether to build the modules.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 drivers/usb/chipidea/Kconfig  |   11 +++++++++++
 drivers/usb/chipidea/Makefile |   11 ++---------
 2 files changed, 13 insertions(+), 9 deletions(-)

--- a/drivers/usb/chipidea/Kconfig
+++ b/drivers/usb/chipidea/Kconfig
@@ -30,4 +30,15 @@ config USB_CHIPIDEA_DEBUG
 	help
 	  Say Y here to enable debugging output of the ChipIdea driver.
 
+config USB_CHIPIDEA_PCI
+	bool "ChipIdea PCI support"
+	depends on PCI
+	help
+	  This option enables ChipIdea support on PCI.
+
+config USB_CHIPIDEA_IMX
+	bool "ChipIdea IMX support"
+	depends on OF
+	help
+	  This option enables ChipIdea support on IMX.
 endif
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -10,12 +10,5 @@ ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG)	+=
 
 obj-$(CONFIG_USB_CHIPIDEA)	+= ci_hdrc_msm.o
 obj-$(CONFIG_USB_CHIPIDEA)	+= ci_hdrc_zevio.o
-
-# PCI doesn't provide stubs, need to check
-ifneq ($(CONFIG_PCI),)
-	obj-$(CONFIG_USB_CHIPIDEA)	+= ci_hdrc_pci.o
-endif
-
-ifneq ($(CONFIG_OF),)
-	obj-$(CONFIG_USB_CHIPIDEA)	+= usbmisc_imx.o ci_hdrc_imx.o
-endif
+obj-$(CONFIG_USB_CHIPIDEA_PCI)	+= ci_hdrc_pci.o
+obj-$(CONFIG_USB_CHIPIDEA_IMX)	+= usbmisc_imx.o ci_hdrc_imx.o