Skip to content

Commit 14fbff6

Browse files
arndbJonathan Corbet
authored andcommitted
samples: connector: from Documentation to samples directory
A small bug with the new autoksyms support showed that there are two kernel modules in the Documentation directory that qualify as samples, while all other samples are in the samples/ directory. This patch was originally meant as a workaround for that bug, but it has now been solved in a different way. However, I still think it makes sense as a cleanup to consolidate all sample code in one place. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent 715cda7 commit 14fbff6

8 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎Documentation/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
subdir-y := accounting auxdisplay blackfin connector \
1+
subdir-y := accounting auxdisplay blackfin \
22
filesystems filesystems ia64 laptops mic misc-devices \
33
networking pcmcia prctl ptp timers vDSO video4linux \
44
watchdog

‎Documentation/connector/connector.txt‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,11 @@ only cn_test.c test module used it.
186186
Some work in netlink area is still being done, so things can be changed in
187187
2.6.15 timeframe, if it will happen, documentation will be updated for that
188188
kernel.
189+
190+
/*****************************************/
191+
Code samples
192+
/*****************************************/
193+
194+
Sample code for a connector test module and user space can be found
195+
in samples/connector/. To build this code, enable CONFIG_CONNECTOR
196+
and CONFIG_SAMPLES.

‎samples/Kconfig‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,13 @@ config SAMPLE_CONFIGFS
7676
help
7777
Builds a sample configfs interface.
7878

79+
config SAMPLE_CONNECTOR
80+
tristate "Build connector sample -- loadable modules only"
81+
depends on CONNECTOR && m
82+
help
83+
When enabled, this builds both a sample kernel module for
84+
the connector interface and a user space tool to communicate
85+
with it.
86+
See also Documentation/connector/connector.txt
87+
7988
endif # SAMPLES

‎samples/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \
44
hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
5-
configfs/
5+
configfs/ connector/
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
ifneq ($(CONFIG_CONNECTOR),)
2-
obj-m += cn_test.o
3-
endif
1+
obj-$(CONFIG_SAMPLE_CONNECTOR) += cn_test.o
42

53
# List of programs to build
4+
ifdef CONFIG_SAMPLE_CONNECTOR
65
hostprogs-y := ucon
6+
endif
77

88
# Tell kbuild to always build the programs
99
always := $(hostprogs-y)

0 commit comments

Comments
 (0)