]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: psmouse - drop all unneeded functions from mouse headers
authorHui Wang <hui.wang@canonical.com>
Tue, 20 Aug 2019 19:07:01 +0000 (12:07 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 20 Aug 2019 21:15:36 +0000 (14:15 -0700)
Recently we had a building error if we enable the MOUSE_PS2_ALPS while
disable the MOUSE_PS2_TRACKPOINT, and was fixed by 49e6979e7e92
("Input: psmouse - fix build error of multiple definition").

We could improve that fix by dropping all unneeded functions and
CONFIG_MOUSE_ guards from the header, it is safe to do that since
those functions are not directly called by psmouse-base.c anymore.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/alps.h
drivers/input/mouse/byd.h
drivers/input/mouse/cypress_ps2.h
drivers/input/mouse/elantech.h
drivers/input/mouse/hgpk.h
drivers/input/mouse/lifebook.h
drivers/input/mouse/logips2pp.h
drivers/input/mouse/sentelic.h
drivers/input/mouse/touchkit_ps2.h
drivers/input/mouse/trackpoint.h
drivers/input/mouse/vmmouse.h

index f4bab629739cd2a06be05b593ba864c86b1af334..0a1048cf23f6abeaaf554224f0c30cce7abbf2d3 100644 (file)
@@ -323,18 +323,7 @@ struct alps_data {
 
 #define ALPS_QUIRK_TRACKSTICK_BUTTONS  1 /* trakcstick buttons in trackstick packet */
 
-#ifdef CONFIG_MOUSE_PS2_ALPS
 int alps_detect(struct psmouse *psmouse, bool set_properties);
 int alps_init(struct psmouse *psmouse);
-#else
-inline int alps_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-inline int alps_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_ALPS */
 
 #endif
index 8cb90d904186cfe29d76abfd2975654248f1b101..ff2771e2dd2e08f70ec8223c4ff45905dcad603a 100644 (file)
@@ -2,18 +2,7 @@
 #ifndef _BYD_H
 #define _BYD_H
 
-#ifdef CONFIG_MOUSE_PS2_BYD
 int byd_detect(struct psmouse *psmouse, bool set_properties);
 int byd_init(struct psmouse *psmouse);
-#else
-static inline int byd_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-static inline int byd_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_BYD */
 
 #endif /* _BYD_H */
index 1eaddd81800460be0157cbcc71545dc0f6f31e7d..bb4979d06bf994e320df80fcd69fb623d5be6a55 100644 (file)
@@ -170,18 +170,7 @@ struct cytp_data {
 };
 
 
-#ifdef CONFIG_MOUSE_PS2_CYPRESS
 int cypress_detect(struct psmouse *psmouse, bool set_properties);
 int cypress_init(struct psmouse *psmouse);
-#else
-inline int cypress_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-inline int cypress_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_CYPRESS */
 
 #endif  /* _CYPRESS_PS2_H */
index 46343998522b047cfa9b0e531a935a1dc5a0ace2..e0a3e59d4f1bbd46426bc802218e3f9d9978ece6 100644 (file)
@@ -184,32 +184,18 @@ struct elantech_data {
        void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
 };
 
-#ifdef CONFIG_MOUSE_PS2_ELANTECH
 int elantech_detect(struct psmouse *psmouse, bool set_properties);
 int elantech_init_ps2(struct psmouse *psmouse);
+
+#ifdef CONFIG_MOUSE_PS2_ELANTECH
 int elantech_init(struct psmouse *psmouse);
 #else
-static inline int elantech_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
 static inline int elantech_init(struct psmouse *psmouse)
 {
        return -ENOSYS;
 }
-static inline int elantech_init_ps2(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
 #endif /* CONFIG_MOUSE_PS2_ELANTECH */
 
-#if defined(CONFIG_MOUSE_PS2_ELANTECH_SMBUS)
 int elantech_init_smbus(struct psmouse *psmouse);
-#else
-static inline int elantech_init_smbus(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_ELANTECH_SMBUS */
 
 #endif
index 98b7b384229b5f91e3718caa1ea26efda910bdd6..ce041591f1a8b61f58fe1cf64e95ed3aa48f0451 100644 (file)
@@ -47,22 +47,15 @@ struct hgpk_data {
        int xsaw_secondary, ysaw_secondary; /* jumpiness detection */
 };
 
-#ifdef CONFIG_MOUSE_PS2_OLPC
-void hgpk_module_init(void);
 int hgpk_detect(struct psmouse *psmouse, bool set_properties);
 int hgpk_init(struct psmouse *psmouse);
+
+#ifdef CONFIG_MOUSE_PS2_OLPC
+void hgpk_module_init(void);
 #else
 static inline void hgpk_module_init(void)
 {
 }
-static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENODEV;
-}
-static inline int hgpk_init(struct psmouse *psmouse)
-{
-       return -ENODEV;
-}
 #endif
 
 #endif
index 573f2ca1983dc687a4f8726eed741152de4a81e1..d989cca62dd628b1a0f4833fe199da2c6bb1d117 100644 (file)
@@ -8,22 +8,15 @@
 #ifndef _LIFEBOOK_H
 #define _LIFEBOOK_H
 
-#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
-void lifebook_module_init(void);
 int lifebook_detect(struct psmouse *psmouse, bool set_properties);
 int lifebook_init(struct psmouse *psmouse);
+
+#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
+void lifebook_module_init(void);
 #else
 static inline void lifebook_module_init(void)
 {
 }
-static inline int lifebook_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-static inline int lifebook_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
 #endif
 
 #endif
index 5f9344135f700f53d9beef24aa8fc2f709535e2e..df885c4874df0f4ed3c25d0656cdecbc3f1ee809 100644 (file)
@@ -8,13 +8,6 @@
 #ifndef _LOGIPS2PP_H
 #define _LOGIPS2PP_H
 
-#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
 int ps2pp_detect(struct psmouse *psmouse, bool set_properties);
-#else
-static inline int ps2pp_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_LOGIPS2PP */
 
 #endif
index dc88a93adf85ccd1590fd936d080a3b65e169011..02cac0e7ad639fac53ba0fe6f9a00ebe0e563ae4 100644 (file)
@@ -106,19 +106,8 @@ struct fsp_data {
        unsigned int    last_mt_fgr;    /* Last seen finger(multitouch) */
 };
 
-#ifdef CONFIG_MOUSE_PS2_SENTELIC
 extern int fsp_detect(struct psmouse *psmouse, bool set_properties);
 extern int fsp_init(struct psmouse *psmouse);
-#else
-static inline int fsp_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-static inline int fsp_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif
 
 #endif /* __KERNEL__ */
 
index 5acb76464a5bbeac7f12bf1097cb194e825b7a75..c808fe6c782f730a163504119ea369191752814f 100644 (file)
@@ -9,14 +9,6 @@
 #ifndef _TOUCHKIT_PS2_H
 #define _TOUCHKIT_PS2_H
 
-#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
 int touchkit_ps2_detect(struct psmouse *psmouse, bool set_properties);
-#else
-static inline int touchkit_ps2_detect(struct psmouse *psmouse,
-                                     bool set_properties)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_TOUCHKIT */
 
 #endif
index 77110f3ec21dab55ace28674f6e77eaec1b62306..5cb93ed260856101765b4df8f35629440f7c0973 100644 (file)
@@ -155,14 +155,6 @@ struct trackpoint_data {
        bool ext_dev;
 };
 
-#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
 int trackpoint_detect(struct psmouse *psmouse, bool set_properties);
-#else
-static inline int trackpoint_detect(struct psmouse *psmouse,
-                                   bool set_properties)
-{
-       return -ENOSYS;
-}
-#endif /* CONFIG_MOUSE_PS2_TRACKPOINT */
 
 #endif /* _TRACKPOINT_H */
index 774549a1293066afc96471b5af5df5c098e45a31..90157aecade7de3bd7e112d750768b6a5a4ad831 100644 (file)
@@ -8,20 +8,9 @@
 #ifndef _VMMOUSE_H
 #define _VMMOUSE_H
 
-#ifdef CONFIG_MOUSE_PS2_VMMOUSE
 #define VMMOUSE_PSNAME  "VirtualPS/2"
 
 int vmmouse_detect(struct psmouse *psmouse, bool set_properties);
 int vmmouse_init(struct psmouse *psmouse);
-#else
-static inline int vmmouse_detect(struct psmouse *psmouse, bool set_properties)
-{
-       return -ENOSYS;
-}
-static inline int vmmouse_init(struct psmouse *psmouse)
-{
-       return -ENOSYS;
-}
-#endif
 
 #endif