diff options
author | Adrian Bunk <bunk@stusta.de> | 2005-05-28 03:11:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-05-28 03:11:12 -0400 |
commit | 668d1e6093110f7534e661e2ff43d54c74659b6d (patch) | |
tree | 58823c949c881605fdf7b23876f2f682fa52effb /include | |
parent | 271b74d0b886301f297407dd7ae11b99607f8089 (diff) |
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gameport.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index b1272f822cfa..cd623eccdbea 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -67,6 +67,8 @@ int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mo | |||
67 | void gameport_close(struct gameport *gameport); | 67 | void gameport_close(struct gameport *gameport); |
68 | void gameport_rescan(struct gameport *gameport); | 68 | void gameport_rescan(struct gameport *gameport); |
69 | 69 | ||
70 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) | ||
71 | |||
70 | void __gameport_register_port(struct gameport *gameport, struct module *owner); | 72 | void __gameport_register_port(struct gameport *gameport, struct module *owner); |
71 | static inline void gameport_register_port(struct gameport *gameport) | 73 | static inline void gameport_register_port(struct gameport *gameport) |
72 | { | 74 | { |
@@ -75,6 +77,29 @@ static inline void gameport_register_port(struct gameport *gameport) | |||
75 | 77 | ||
76 | void gameport_unregister_port(struct gameport *gameport); | 78 | void gameport_unregister_port(struct gameport *gameport); |
77 | 79 | ||
80 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | ||
81 | __attribute__ ((format (printf, 2, 3))); | ||
82 | |||
83 | #else | ||
84 | |||
85 | static inline void gameport_register_port(struct gameport *gameport) | ||
86 | { | ||
87 | return; | ||
88 | } | ||
89 | |||
90 | static inline void gameport_unregister_port(struct gameport *gameport) | ||
91 | { | ||
92 | return; | ||
93 | } | ||
94 | |||
95 | static inline void gameport_set_phys(struct gameport *gameport, | ||
96 | const char *fmt, ...) | ||
97 | { | ||
98 | return; | ||
99 | } | ||
100 | |||
101 | #endif | ||
102 | |||
78 | static inline struct gameport *gameport_allocate_port(void) | 103 | static inline struct gameport *gameport_allocate_port(void) |
79 | { | 104 | { |
80 | struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); | 105 | struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); |
@@ -92,9 +117,6 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name | |||
92 | strlcpy(gameport->name, name, sizeof(gameport->name)); | 117 | strlcpy(gameport->name, name, sizeof(gameport->name)); |
93 | } | 118 | } |
94 | 119 | ||
95 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | ||
96 | __attribute__ ((format (printf, 2, 3))); | ||
97 | |||
98 | /* | 120 | /* |
99 | * Use the following fucntions to manipulate gameport's per-port | 121 | * Use the following fucntions to manipulate gameport's per-port |
100 | * driver-specific data. | 122 | * driver-specific data. |