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>
This commit is contained in:
committed by
Dmitry Torokhov
parent
271b74d0b8
commit
668d1e6093
@@ -67,6 +67,8 @@ int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mo
|
||||
void gameport_close(struct gameport *gameport);
|
||||
void gameport_rescan(struct gameport *gameport);
|
||||
|
||||
#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
|
||||
|
||||
void __gameport_register_port(struct gameport *gameport, struct module *owner);
|
||||
static inline void gameport_register_port(struct gameport *gameport)
|
||||
{
|
||||
@@ -75,6 +77,29 @@ static inline void gameport_register_port(struct gameport *gameport)
|
||||
|
||||
void gameport_unregister_port(struct gameport *gameport);
|
||||
|
||||
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
#else
|
||||
|
||||
static inline void gameport_register_port(struct gameport *gameport)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void gameport_unregister_port(struct gameport *gameport)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void gameport_set_phys(struct gameport *gameport,
|
||||
const char *fmt, ...)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static inline struct gameport *gameport_allocate_port(void)
|
||||
{
|
||||
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
|
||||
strlcpy(gameport->name, name, sizeof(gameport->name));
|
||||
}
|
||||
|
||||
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
|
||||
/*
|
||||
* Use the following fucntions to manipulate gameport's per-port
|
||||
* driver-specific data.
|
||||
|
Reference in New Issue
Block a user