Skip to contentSkip to conversation

Input: joystick - work around "adi" module name confict

PATCH In review Arnd Bergmann 3 participants 3 messages Jun 9, 2020 – Jun 11, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: joystick - work around "adi" module name confict

Making module name conflicts a fatal error breaks sparc64 allmodconfig:

Error log:
error: the following would cause module name conflict:
drivers/char/adi.ko drivers/input/joystick/adi.ko

Renaming one of the modules would solve the problem, but then cause other problems because neither of them is automatically loaded and changing the name is likely to break any setup that relies on manually loading it by name.

As there is probably no sparc64 system with this kind of ancient joystick attached, work around it by adding a Kconfig dependency that forbids them from both being modules. It is still possible to build the joystick driver if the sparc64 adi driver is built-in.

---
This should get merged through the kbuild tree together with the patch that turns the warning into an error, if the joystick maintainers are ok with the hack.

---
 drivers/input/joystick/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/Kconfig +1 -0
index 940b744639c7..6f73f02059b5 100644
@@ -45,6 +45,7 @@ config JOYSTICK_A3D
 config JOYSTICK_ADI
 	tristate "Logitech ADI digital joysticks and gamepads"
 	select GAMEPORT
+	depends on ADI!=m # avoid module name conflict
 	help
 	  Say Y here if you have a Logitech controller using the ADI
 	  protocol over the PC gameport.
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Arnd Bergmann

Making module name conflicts a fatal error breaks sparc64 allmodconfig:

Error log:
error: the following would cause module name conflict:
drivers/char/adi.ko drivers/input/joystick/adi.ko

Renaming one of the modules would solve the problem, but then cause other problems because neither of them is automatically loaded and changing the name is likely to break any setup that relies on manually loading it by name.

As there is probably no sparc64 system with this kind of ancient joystick attached, work around it by adding a Kconfig dependency that forbids them from both being modules. It is still possible to build the joystick driver if the sparc64 adi driver is built-in.

Quoted 6 lines
Quoted 21 lines

---
This should get merged through the kbuild tree together with the patch that turns the warning into an error, if the joystick maintainers are ok with the hack.

---
 drivers/input/joystick/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/Kconfig +1 -0
index 940b744639c7..6f73f02059b5 100644
@@ -45,6 +45,7 @@ config JOYSTICK_A3D
 config JOYSTICK_ADI
 	tristate "Logitech ADI digital joysticks and gamepads"
 	select GAMEPORT
+	depends on ADI!=m # avoid module name conflict
 	help
 	  Say Y here if you have a Logitech controller using the ADI
 	  protocol over the PC gameport.
#2 lore raw
In reply to Arnd Bergmann
Quoted 25 lines · Arnd Bergmann

Making module name conflicts a fatal error breaks sparc64 allmodconfig:

Error log:
error: the following would cause module name conflict:
drivers/char/adi.ko drivers/input/joystick/adi.ko

Renaming one of the modules would solve the problem, but then cause other problems because neither of them is automatically loaded and changing the name is likely to break any setup that relies on manually loading it by name.

As there is probably no sparc64 system with this kind of ancient joystick attached, work around it by adding a Kconfig dependency that forbids them from both being modules. It is still possible to build the joystick driver if the sparc64 adi driver is built-in.

Quoted 4 lines

---
This should get merged through the kbuild tree together with the patch that turns the warning into an error, if the joystick maintainers are ok with the hack.

Note:
Dmitry picked up this patch.
(commit 751ad34fbad74c3ed4a9ede24764b4253d4faa84)

Quoted 19 lines
---
 drivers/input/joystick/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/input/joystick/Kconfig +1 -1
index 940b744639c7..6f73f02059b5 100644
@@ -45,6 +45,7 @@ config JOYSTICK_A3D
 config JOYSTICK_ADI
        tristate "Logitech ADI digital joysticks and gamepads"
        select GAMEPORT
+       depends on ADI!=m # avoid module name conflict
        help
          Say Y here if you have a Logitech controller using the ADI
          protocol over the PC gameport.
--

2.26.2

Signature · 2 lines
Best Regards
Masahiro Yamada