Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: This patch adds dummy gameport_register_port, gameport_unregister_port and gameport_set_phys functions to gameport.h for the case when a driver can't use gameport.

This fixes the compilation of some OSS drivers with GAMEPORT=n without
the need to #if inside every single driver.

This patch also removes the non-working and now obsolete SOUND_GAMEPORT.

This patch is also an alternative solution for ALSA drivers with similar
problems (but #if's inside the drivers might have the advantage of
saving some more bytes of gameport is not available).

The only user-visible change is that for GAMEPORT=m the affected OSS
drivers are now allowed to be built statically (but they won't have
gameport support).

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Adrian Bunk and committed by
Dmitry Torokhov
668d1e60 271b74d0

+31 -29
-20
drivers/input/gameport/Kconfig
··· 68 68 depends on PCI 69 69 70 70 endif 71 - 72 - # Yes, SOUND_GAMEPORT looks a bit odd. Yes, it ends up being turned on 73 - # in every .config. Please don't touch it. It is here to handle an 74 - # unusual dependency between GAMEPORT and sound drivers. 75 - # 76 - # Some sound drivers call gameport functions. If GAMEPORT is 77 - # not selected, empty stubs are provided for the functions and all is 78 - # well. 79 - # If GAMEPORT is built in, everything is fine. 80 - # If GAMEPORT is a module, however, it would need to be loaded for the 81 - # sound driver to be able to link properly. Therefore, the sound 82 - # driver must be a module as well in that case. Since there's no way 83 - # to express that directly in Kconfig, we use SOUND_GAMEPORT to 84 - # express it. SOUND_GAMEPORT boils down to "if GAMEPORT is 'm', 85 - # anything that depends on SOUND_GAMEPORT must be 'm' as well. if 86 - # GAMEPORT is 'y' or 'n', it can be anything". 87 - config SOUND_GAMEPORT 88 - tristate 89 - default m if GAMEPORT=m 90 - default y
+25 -3
include/linux/gameport.h
··· 67 67 void gameport_close(struct gameport *gameport); 68 68 void gameport_rescan(struct gameport *gameport); 69 69 70 + #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) 71 + 70 72 void __gameport_register_port(struct gameport *gameport, struct module *owner); 71 73 static inline void gameport_register_port(struct gameport *gameport) 72 74 { ··· 76 74 } 77 75 78 76 void gameport_unregister_port(struct gameport *gameport); 77 + 78 + void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) 79 + __attribute__ ((format (printf, 2, 3))); 80 + 81 + #else 82 + 83 + static inline void gameport_register_port(struct gameport *gameport) 84 + { 85 + return; 86 + } 87 + 88 + static inline void gameport_unregister_port(struct gameport *gameport) 89 + { 90 + return; 91 + } 92 + 93 + static inline void gameport_set_phys(struct gameport *gameport, 94 + const char *fmt, ...) 95 + { 96 + return; 97 + } 98 + 99 + #endif 79 100 80 101 static inline struct gameport *gameport_allocate_port(void) 81 102 { ··· 116 91 { 117 92 strlcpy(gameport->name, name, sizeof(gameport->name)); 118 93 } 119 - 120 - void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) 121 - __attribute__ ((format (printf, 2, 3))); 122 94 123 95 /* 124 96 * Use the following fucntions to manipulate gameport's per-port
+6 -6
sound/oss/Kconfig
··· 112 112 113 113 config SOUND_ES1370 114 114 tristate "Ensoniq AudioPCI (ES1370)" 115 - depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT 115 + depends on SOUND_PRIME!=n && SOUND && PCI 116 116 help 117 117 Say Y or M if you have a PCI sound card utilizing the Ensoniq 118 118 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find ··· 125 125 126 126 config SOUND_ES1371 127 127 tristate "Creative Ensoniq AudioPCI 97 (ES1371)" 128 - depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT 128 + depends on SOUND_PRIME!=n && SOUND && PCI 129 129 help 130 130 Say Y or M if you have a PCI sound card utilizing the Ensoniq 131 131 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if ··· 138 138 139 139 config SOUND_ESSSOLO1 140 140 tristate "ESS Technology Solo1" 141 - depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT && PCI 141 + depends on SOUND_PRIME!=n && SOUND && PCI 142 142 help 143 143 Say Y or M if you have a PCI sound card utilizing the ESS Technology 144 144 Solo1 chip. To find out if your sound card uses a ··· 179 179 180 180 config SOUND_SONICVIBES 181 181 tristate "S3 SonicVibes" 182 - depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT 182 + depends on SOUND_PRIME!=n && SOUND 183 183 help 184 184 Say Y or M if you have a PCI sound card utilizing the S3 185 185 SonicVibes chipset. To find out if your sound card uses a ··· 226 226 227 227 config SOUND_TRIDENT 228 228 tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core" 229 - depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT 229 + depends on SOUND_PRIME!=n && SOUND 230 230 ---help--- 231 231 Say Y or M if you have a PCI sound card utilizing the Trident 232 232 4DWave-DX/NX chipset or your mother board chipset has SiS 7018 ··· 739 739 740 740 config SOUND_MAD16 741 741 tristate "OPTi MAD16 and/or Mozart based cards" 742 - depends on SOUND_OSS && SOUND_GAMEPORT 742 + depends on SOUND_OSS 743 743 ---help--- 744 744 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi 745 745 82C928 or 82C929 or 82C931) audio interface chip. These chips are