* Re: [next:master 23/358] undefined reference to `i2c_add_adapter'
[not found] ` <20131103120853.GA1731@localhost>
@ 2013-11-03 12:36 ` Samuel Thibault
2013-11-03 13:27 ` [next:master 23/358] undefined reference to `input_led_disconnect' Samuel Thibault
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Thibault @ 2013-11-03 12:36 UTC (permalink / raw)
To: Pavel Machek, Dmitry Torokhov, David Herrmann, akpm, jslaby,
Bryan Wu, rpurdie, linux-kernel, Evan Broder, Arnaud Patard,
Peter Korsgaard, Sascha Hauer, Matt Sealey, Rob Clark,
Niels de Vos, linux-arm-kernel, Steev Klimaszewski, Fengguang Wu
Cc: Andrew Morton, kbuild-all
Fengguang Wu, le Sun 03 Nov 2013 20:08:53 +0800, a écrit :
> It's a bug fix that unveils the link errors.
>
> drivers/built-in.o: In function `__input_unregister_device':
> input.c:(.text+0xf0e55): undefined reference to `input_led_disconnect'
Ok, so the "something like this" in the patch review was really not so
trivial :)
To summarize, input.c needs to call leds.c to register its LEDs,
and leds.c uses input.c functions, such as input_event. So in the
all-modules case we have a circular dependency, and when one is built-in
but not the other, we get an undefined reference. In my original patch
input.c would not call leds.c when built as module, and then the module
wouldn't be useful any more.
So in the end it would probably be simpler to just stuff leds.c along
input.c in input.ko or built-in. CONFIG_INPUT_LEDS will thus become a
bool. I'm working on that now.
Samuel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [next:master 23/358] undefined reference to `input_led_disconnect'
2013-11-03 12:36 ` [next:master 23/358] undefined reference to `i2c_add_adapter' Samuel Thibault
@ 2013-11-03 13:27 ` Samuel Thibault
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Thibault @ 2013-11-03 13:27 UTC (permalink / raw)
To: Pavel Machek, Dmitry Torokhov, David Herrmann, akpm, jslaby,
Bryan Wu, rpurdie, linux-kernel, Evan Broder, Arnaud Patard,
Peter Korsgaard, Sascha Hauer, Matt Sealey, Rob Clark,
Niels de Vos, linux-arm-kernel, Steev Klimaszewski, Fengguang Wu,
kbuild-all
Samuel Thibault, le Sun 03 Nov 2013 13:36:21 +0100, a écrit :
> So in the end it would probably be simpler to just stuff leds.c along
> input.c in input.ko or built-in. CONFIG_INPUT_LEDS will thus become a
> bool. I'm working on that now.
Here it is. This replaces both
input-route-kbd-leds-through-the-generic-leds-layer-fix-fix.patch
input-route-kbd-leds-through-the-generic-leds-layer-fix-fix-fix.patch
(input-route-kbd-leds-through-the-generic-leds-layer-fix.patch is still
needed)
Samuel
Link input/leds.c along input/input.c instead of separate module
input.c needs to call leds.c and vice-versa, so it is simpler to stuff
them together. INPUT_LEDS thus now depends on LEDS_CLASS being available
enough for input.ko.
This also documents the new leds field.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
diff -u a/drivers/input/Makefile b/drivers/input/Makefile
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -6,6 +6,9 @@
obj-$(CONFIG_INPUT) += input-core.o
input-core-y := input.o input-compat.o input-mt.o ff-core.o
+ifeq ($(CONFIG_INPUT_LEDS),y)
+input-core-y += leds.o
+endif
obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
@@ -16,7 +19,6 @@
obj-$(CONFIG_INPUT_JOYDEV) += joydev.o
obj-$(CONFIG_INPUT_EVDEV) += evdev.o
obj-$(CONFIG_INPUT_EVBUG) += evbug.o
-obj-$(CONFIG_INPUT_LEDS) += leds.o
obj-$(CONFIG_INPUT_KEYBOARD) += keyboard/
obj-$(CONFIG_INPUT_MOUSE) += mouse/
diff -u a/drivers/input/Kconfig b/drivers/input/Kconfig
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -179,8 +179,8 @@
source "drivers/input/keyboard/Kconfig"
config INPUT_LEDS
- tristate "LED Support"
- depends on LEDS_CLASS
+ bool "LED Support"
+ depends on LEDS_CLASS = INPUT || LEDS_CLASS = y
select LEDS_TRIGGERS
default y
help
diff -u a/include/linux/input.h b/include/linux/input.h
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -79,6 +79,7 @@
* @led: reflects current state of device's LEDs
* @snd: reflects current state of sound effects
* @sw: reflects current state of device's switches
+ * @leds: leds objects for the device's LEDs
* @open: this method is called when the very first user calls
* input_open_device(). The driver must prepare the device
* to start generating events (start polling thread,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-03 13:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <5275bf42.KMmrPUiia86VoRbL%fengguang.wu@intel.com>
[not found] ` <20131103120853.GA1731@localhost>
2013-11-03 12:36 ` [next:master 23/358] undefined reference to `i2c_add_adapter' Samuel Thibault
2013-11-03 13:27 ` [next:master 23/358] undefined reference to `input_led_disconnect' Samuel Thibault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).