diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-06-06 11:16:25 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-06-06 11:42:51 -0700 |
commit | f11f1a92c17385ff4d6e2bc8002d59aed70b98c4 (patch) | |
tree | 7d4f1c4452d3b3af5459c6d7a52ba2e61c7c936d /include/linux/gameport.h | |
parent | d9f12a3bbb6d1afe872425a8fa2612945975cfb8 (diff) | |
download | lwn-f11f1a92c17385ff4d6e2bc8002d59aed70b98c4.tar.gz lwn-f11f1a92c17385ff4d6e2bc8002d59aed70b98c4.zip |
Input: gameport - provide default trigger() and read()
Instead of constantly checking pointer(s) for non-NULL-ness provide
default implementations of trigger() and read() and instantiate them during
pore registration if driver-specific versions were not provided.
Link: https://lore.kernel.org/r/ZGvoqP5PAAsJuky4@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/linux/gameport.h')
-rw-r--r-- | include/linux/gameport.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 8c2f00018e89..0a221e768ea4 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h @@ -5,7 +5,6 @@ #ifndef _GAMEPORT_H #define _GAMEPORT_H -#include <asm/io.h> #include <linux/types.h> #include <linux/list.h> #include <linux/mutex.h> @@ -165,18 +164,12 @@ void gameport_unregister_driver(struct gameport_driver *drv); static inline void gameport_trigger(struct gameport *gameport) { - if (gameport->trigger) - gameport->trigger(gameport); - else - outb(0xff, gameport->io); + gameport->trigger(gameport); } static inline unsigned char gameport_read(struct gameport *gameport) { - if (gameport->read) - return gameport->read(gameport); - else - return inb(gameport->io); + return gameport->read(gameport); } static inline int gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons) |