Do not build GPIO part of CCAT if GPIO is not configured in kernel.

This commit is contained in:
Florian Pose 2017-09-08 13:50:06 +02:00
parent 277bc127c8
commit 25bdba8bbd
3 changed files with 13 additions and 4 deletions

View File

@ -34,14 +34,18 @@
TOPDIR := $(src)/../.. TOPDIR := $(src)/../..
ifeq (@ENABLE_CCAT@,1) ifeq (@ENABLE_CCAT@,1)
EC_CCAT_OBJ := \ obj-m += ec_ccat.o
gpio.o \
ec_ccat-objs := \
module.o \ module.o \
netdev.o \ netdev.o \
sram.o \ sram.o \
update.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) CFLAGS_ccat_main-ethercat.o = -DREV=$(REV)
endif endif

View File

@ -54,7 +54,9 @@ static const struct ccat_driver *const drivers[] = {
&eth_dma_driver, /* load Ethernet MAC/EtherCAT Master driver with DMA support from netdev.c */ &eth_dma_driver, /* load Ethernet MAC/EtherCAT Master driver with DMA support from netdev.c */
#endif #endif
&eth_eim_driver, /* load Ethernet MAC/EtherCAT Master driver without DMA support from */ &eth_eim_driver, /* load Ethernet MAC/EtherCAT Master driver without DMA support from */
#ifdef CONFIG_GPIO
&gpio_driver, /* load GPIO driver from gpio.c */ &gpio_driver, /* load GPIO driver from gpio.c */
#endif
&sram_driver, /* load SRAM driver from sram.c */ &sram_driver, /* load SRAM driver from sram.c */
&update_driver, /* load Update driver from update.c */ &update_driver, /* load Update driver from update.c */
}; };

View File

@ -37,10 +37,13 @@
extern const struct ccat_driver eth_eim_driver; extern const struct ccat_driver eth_eim_driver;
extern const struct ccat_driver eth_dma_driver; extern const struct ccat_driver eth_dma_driver;
#ifdef CONFIG_GPIO
extern const struct ccat_driver gpio_driver; extern const struct ccat_driver gpio_driver;
#endif
extern const struct ccat_driver sram_driver; extern const struct ccat_driver sram_driver;
extern const struct ccat_driver update_driver; extern const struct ccat_driver update_driver;
/** /**
* CCAT function type identifiers (u16) * CCAT function type identifiers (u16)
*/ */