Do not build GPIO part of CCAT if GPIO is not configured in kernel. stable-1.5
authorFlorian Pose <fp@igh.de>
Fri, 08 Sep 2017 13:50:06 +0200
branchstable-1.5
changeset 2684 56587a22d05c
parent 2683 1079c149f22c
child 2685 740291442c05
Do not build GPIO part of CCAT if GPIO is not configured in kernel.
devices/ccat/Kbuild.in
devices/ccat/module.c
devices/ccat/module.h
--- a/devices/ccat/Kbuild.in	Fri Sep 08 13:16:57 2017 +0200
+++ b/devices/ccat/Kbuild.in	Fri Sep 08 13:50:06 2017 +0200
@@ -34,14 +34,18 @@
 TOPDIR := $(src)/../..
 
 ifeq (@ENABLE_CCAT@,1)
-	EC_CCAT_OBJ := \
-		gpio.o \
+	obj-m += ec_ccat.o
+
+	ec_ccat-objs := \
 		module.o \
 		netdev.o \
 		sram.o \
 		update.o
-	obj-m += ec_ccat.o
-	ec_ccat-objs := $(EC_CCAT_OBJ)
+
+ifdef CONFIG_GPIO
+	ec_ccat-objs += gpio.o
+endif
+
 	CFLAGS_ccat_main-ethercat.o = -DREV=$(REV)
 endif
 
--- a/devices/ccat/module.c	Fri Sep 08 13:16:57 2017 +0200
+++ b/devices/ccat/module.c	Fri Sep 08 13:50:06 2017 +0200
@@ -54,7 +54,9 @@
 	&eth_dma_driver,	/* load Ethernet MAC/EtherCAT Master driver with DMA support from netdev.c */
 #endif
 	&eth_eim_driver,	/* load Ethernet MAC/EtherCAT Master driver without DMA support from */
+#ifdef CONFIG_GPIO
 	&gpio_driver,		/* load GPIO driver from gpio.c */
+#endif
 	&sram_driver,		/* load SRAM driver from sram.c */
 	&update_driver,		/* load Update driver from update.c */
 };
--- a/devices/ccat/module.h	Fri Sep 08 13:16:57 2017 +0200
+++ b/devices/ccat/module.h	Fri Sep 08 13:50:06 2017 +0200
@@ -37,10 +37,13 @@
 
 extern const struct ccat_driver eth_eim_driver;
 extern const struct ccat_driver eth_dma_driver;
+#ifdef CONFIG_GPIO
 extern const struct ccat_driver gpio_driver;
+#endif
 extern const struct ccat_driver sram_driver;
 extern const struct ccat_driver update_driver;
 
+
 /**
  * CCAT function type identifiers (u16)
  */