@@ -1,4 +1,4 @@
-subdir-y := accounting auxdisplay blackfin connector \
+subdir-y := accounting auxdisplay blackfin \
filesystems filesystems ia64 laptops mic misc-devices \
networking pcmcia prctl ptp timers vDSO video4linux \
watchdog
@@ -186,3 +186,11 @@ only cn_test.c test module used it.
Some work in netlink area is still being done, so things can be changed in
2.6.15 timeframe, if it will happen, documentation will be updated for that
kernel.
+
+/*****************************************/
+Code samples
+/*****************************************/
+
+Sample code for a connector test module and user space can be found
+in samples/connector/. To build this code, enable CONFIG_CONNECTOR
+and CONFIG_SAMPLES.
@@ -76,4 +76,13 @@ config SAMPLE_CONFIGFS
help
Builds a sample configfs interface.
+config SAMPLE_CONNECTOR
+ tristate "Build connector sample -- loadable modules only"
+ depends on CONNECTOR && m
+ help
+ When enabled, this builds both a sample kernel module for
+ the connector interface and a user space tool to communicate
+ with it.
+ See also Documentation/connector/connector.txt
+
endif # SAMPLES
@@ -2,4 +2,4 @@
obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \
hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
- configfs/
+ configfs/ connector/
similarity index 100%
rename from Documentation/connector/.gitignore
rename to samples/connector/.gitignore
similarity index 76%
rename from Documentation/connector/Makefile
rename to samples/connector/Makefile
@@ -1,9 +1,9 @@
-ifneq ($(CONFIG_CONNECTOR),)
-obj-m += cn_test.o
-endif
+obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o
# List of programs to build
+ifdef CONFIG_SAMPLE_CONNECTOR
hostprogs-y := ucon
+endif
# Tell kbuild to always build the programs
always := $(hostprogs-y)
similarity index 100%
rename from Documentation/connector/cn_test.c
rename to samples/connector/cn_test.c
similarity index 100%
rename from Documentation/connector/ucon.c
rename to samples/connector/ucon.c
With the new autoksyms support, we can run into a situation where the connector sample module is the only one using some exported symbols that get dropped because they are never referenced by the kernel otherwise, causing a build problem: ERROR: "cn_del_callback" [Documentation/connector/cn_test.ko] undefined! ERROR: "cn_add_callback" [Documentation/connector/cn_test.ko] undefined! ERROR: "cn_netlink_send" [Documentation/connector/cn_test.ko] undefined! Specifically, we do look in the samples directory for users of symbols, but not the Documentation directory. This solves the build problem by moving the connector sample into the same directory as the other samples. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 23121ca2b56b ("kbuild: create/adjust generated/autoksyms.h") --- Documentation/Makefile | 2 +- Documentation/connector/connector.txt | 8 ++++++++ samples/Kconfig | 9 +++++++++ samples/Makefile | 2 +- {Documentation => samples}/connector/.gitignore | 0 {Documentation => samples}/connector/Makefile | 6 +++--- {Documentation => samples}/connector/cn_test.c | 0 {Documentation => samples}/connector/ucon.c | 0 8 files changed, 22 insertions(+), 5 deletions(-) rename {Documentation => samples}/connector/.gitignore (100%) rename {Documentation => samples}/connector/Makefile (76%) rename {Documentation => samples}/connector/cn_test.c (100%) rename {Documentation => samples}/connector/ucon.c (100%) -- 2.7.0