summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHui Wang <hui.wang@canonical.com>2019-08-20 15:07:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-08-20 17:15:36 -0400
commitcfd8579ddc02d8c5024bae7106ba37079653b3d2 (patch)
tree73fd7dcd7a80e03f3e7fdf9c8b1826d91df922d6
parente95656ea15e54d4e6a192d560d84008b53fc1eb5 (diff)
Input: psmouse - drop all unneeded functions from mouse headers
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>
-rw-r--r--drivers/input/mouse/alps.h11
-rw-r--r--drivers/input/mouse/byd.h11
-rw-r--r--drivers/input/mouse/cypress_ps2.h11
-rw-r--r--drivers/input/mouse/elantech.h18
-rw-r--r--drivers/input/mouse/hgpk.h13
-rw-r--r--drivers/input/mouse/lifebook.h13
-rw-r--r--drivers/input/mouse/logips2pp.h7
-rw-r--r--drivers/input/mouse/sentelic.h11
-rw-r--r--drivers/input/mouse/touchkit_ps2.h8
-rw-r--r--drivers/input/mouse/trackpoint.h8
-rw-r--r--drivers/input/mouse/vmmouse.h11
11 files changed, 8 insertions, 114 deletions
diff --git a/drivers/input/mouse/alps.h b/drivers/input/mouse/alps.h
index f4bab629739c..0a1048cf23f6 100644
--- a/drivers/input/mouse/alps.h
+++ b/drivers/input/mouse/alps.h
@@ -323,18 +323,7 @@ struct alps_data {
323 323
324#define ALPS_QUIRK_TRACKSTICK_BUTTONS 1 /* trakcstick buttons in trackstick packet */ 324#define ALPS_QUIRK_TRACKSTICK_BUTTONS 1 /* trakcstick buttons in trackstick packet */
325 325
326#ifdef CONFIG_MOUSE_PS2_ALPS
327int alps_detect(struct psmouse *psmouse, bool set_properties); 326int alps_detect(struct psmouse *psmouse, bool set_properties);
328int alps_init(struct psmouse *psmouse); 327int alps_init(struct psmouse *psmouse);
329#else
330inline int alps_detect(struct psmouse *psmouse, bool set_properties)
331{
332 return -ENOSYS;
333}
334inline int alps_init(struct psmouse *psmouse)
335{
336 return -ENOSYS;
337}
338#endif /* CONFIG_MOUSE_PS2_ALPS */
339 328
340#endif 329#endif
diff --git a/drivers/input/mouse/byd.h b/drivers/input/mouse/byd.h
index 8cb90d904186..ff2771e2dd2e 100644
--- a/drivers/input/mouse/byd.h
+++ b/drivers/input/mouse/byd.h
@@ -2,18 +2,7 @@
2#ifndef _BYD_H 2#ifndef _BYD_H
3#define _BYD_H 3#define _BYD_H
4 4
5#ifdef CONFIG_MOUSE_PS2_BYD
6int byd_detect(struct psmouse *psmouse, bool set_properties); 5int byd_detect(struct psmouse *psmouse, bool set_properties);
7int byd_init(struct psmouse *psmouse); 6int byd_init(struct psmouse *psmouse);
8#else
9static inline int byd_detect(struct psmouse *psmouse, bool set_properties)
10{
11 return -ENOSYS;
12}
13static inline int byd_init(struct psmouse *psmouse)
14{
15 return -ENOSYS;
16}
17#endif /* CONFIG_MOUSE_PS2_BYD */
18 7
19#endif /* _BYD_H */ 8#endif /* _BYD_H */
diff --git a/drivers/input/mouse/cypress_ps2.h b/drivers/input/mouse/cypress_ps2.h
index 1eaddd818004..bb4979d06bf9 100644
--- a/drivers/input/mouse/cypress_ps2.h
+++ b/drivers/input/mouse/cypress_ps2.h
@@ -170,18 +170,7 @@ struct cytp_data {
170}; 170};
171 171
172 172
173#ifdef CONFIG_MOUSE_PS2_CYPRESS
174int cypress_detect(struct psmouse *psmouse, bool set_properties); 173int cypress_detect(struct psmouse *psmouse, bool set_properties);
175int cypress_init(struct psmouse *psmouse); 174int cypress_init(struct psmouse *psmouse);
176#else
177inline int cypress_detect(struct psmouse *psmouse, bool set_properties)
178{
179 return -ENOSYS;
180}
181inline int cypress_init(struct psmouse *psmouse)
182{
183 return -ENOSYS;
184}
185#endif /* CONFIG_MOUSE_PS2_CYPRESS */
186 175
187#endif /* _CYPRESS_PS2_H */ 176#endif /* _CYPRESS_PS2_H */
diff --git a/drivers/input/mouse/elantech.h b/drivers/input/mouse/elantech.h
index 46343998522b..e0a3e59d4f1b 100644
--- a/drivers/input/mouse/elantech.h
+++ b/drivers/input/mouse/elantech.h
@@ -184,32 +184,18 @@ struct elantech_data {
184 void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate); 184 void (*original_set_rate)(struct psmouse *psmouse, unsigned int rate);
185}; 185};
186 186
187#ifdef CONFIG_MOUSE_PS2_ELANTECH
188int elantech_detect(struct psmouse *psmouse, bool set_properties); 187int elantech_detect(struct psmouse *psmouse, bool set_properties);
189int elantech_init_ps2(struct psmouse *psmouse); 188int elantech_init_ps2(struct psmouse *psmouse);
189
190#ifdef CONFIG_MOUSE_PS2_ELANTECH
190int elantech_init(struct psmouse *psmouse); 191int elantech_init(struct psmouse *psmouse);
191#else 192#else
192static inline int elantech_detect(struct psmouse *psmouse, bool set_properties)
193{
194 return -ENOSYS;
195}
196static inline int elantech_init(struct psmouse *psmouse) 193static inline int elantech_init(struct psmouse *psmouse)
197{ 194{
198 return -ENOSYS; 195 return -ENOSYS;
199} 196}
200static inline int elantech_init_ps2(struct psmouse *psmouse)
201{
202 return -ENOSYS;
203}
204#endif /* CONFIG_MOUSE_PS2_ELANTECH */ 197#endif /* CONFIG_MOUSE_PS2_ELANTECH */
205 198
206#if defined(CONFIG_MOUSE_PS2_ELANTECH_SMBUS)
207int elantech_init_smbus(struct psmouse *psmouse); 199int elantech_init_smbus(struct psmouse *psmouse);
208#else
209static inline int elantech_init_smbus(struct psmouse *psmouse)
210{
211 return -ENOSYS;
212}
213#endif /* CONFIG_MOUSE_PS2_ELANTECH_SMBUS */
214 200
215#endif 201#endif
diff --git a/drivers/input/mouse/hgpk.h b/drivers/input/mouse/hgpk.h
index 98b7b384229b..ce041591f1a8 100644
--- a/drivers/input/mouse/hgpk.h
+++ b/drivers/input/mouse/hgpk.h
@@ -47,22 +47,15 @@ struct hgpk_data {
47 int xsaw_secondary, ysaw_secondary; /* jumpiness detection */ 47 int xsaw_secondary, ysaw_secondary; /* jumpiness detection */
48}; 48};
49 49
50#ifdef CONFIG_MOUSE_PS2_OLPC
51void hgpk_module_init(void);
52int hgpk_detect(struct psmouse *psmouse, bool set_properties); 50int hgpk_detect(struct psmouse *psmouse, bool set_properties);
53int hgpk_init(struct psmouse *psmouse); 51int hgpk_init(struct psmouse *psmouse);
52
53#ifdef CONFIG_MOUSE_PS2_OLPC
54void hgpk_module_init(void);
54#else 55#else
55static inline void hgpk_module_init(void) 56static inline void hgpk_module_init(void)
56{ 57{
57} 58}
58static inline int hgpk_detect(struct psmouse *psmouse, bool set_properties)
59{
60 return -ENODEV;
61}
62static inline int hgpk_init(struct psmouse *psmouse)
63{
64 return -ENODEV;
65}
66#endif 59#endif
67 60
68#endif 61#endif
diff --git a/drivers/input/mouse/lifebook.h b/drivers/input/mouse/lifebook.h
index 573f2ca1983d..d989cca62dd6 100644
--- a/drivers/input/mouse/lifebook.h
+++ b/drivers/input/mouse/lifebook.h
@@ -8,22 +8,15 @@
8#ifndef _LIFEBOOK_H 8#ifndef _LIFEBOOK_H
9#define _LIFEBOOK_H 9#define _LIFEBOOK_H
10 10
11#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
12void lifebook_module_init(void);
13int lifebook_detect(struct psmouse *psmouse, bool set_properties); 11int lifebook_detect(struct psmouse *psmouse, bool set_properties);
14int lifebook_init(struct psmouse *psmouse); 12int lifebook_init(struct psmouse *psmouse);
13
14#ifdef CONFIG_MOUSE_PS2_LIFEBOOK
15void lifebook_module_init(void);
15#else 16#else
16static inline void lifebook_module_init(void) 17static inline void lifebook_module_init(void)
17{ 18{
18} 19}
19static inline int lifebook_detect(struct psmouse *psmouse, bool set_properties)
20{
21 return -ENOSYS;
22}
23static inline int lifebook_init(struct psmouse *psmouse)
24{
25 return -ENOSYS;
26}
27#endif 20#endif
28 21
29#endif 22#endif
diff --git a/drivers/input/mouse/logips2pp.h b/drivers/input/mouse/logips2pp.h
index 5f9344135f70..df885c4874df 100644
--- a/drivers/input/mouse/logips2pp.h
+++ b/drivers/input/mouse/logips2pp.h
@@ -8,13 +8,6 @@
8#ifndef _LOGIPS2PP_H 8#ifndef _LOGIPS2PP_H
9#define _LOGIPS2PP_H 9#define _LOGIPS2PP_H
10 10
11#ifdef CONFIG_MOUSE_PS2_LOGIPS2PP
12int ps2pp_detect(struct psmouse *psmouse, bool set_properties); 11int ps2pp_detect(struct psmouse *psmouse, bool set_properties);
13#else
14static inline int ps2pp_detect(struct psmouse *psmouse, bool set_properties)
15{
16 return -ENOSYS;
17}
18#endif /* CONFIG_MOUSE_PS2_LOGIPS2PP */
19 12
20#endif 13#endif
diff --git a/drivers/input/mouse/sentelic.h b/drivers/input/mouse/sentelic.h
index dc88a93adf85..02cac0e7ad63 100644
--- a/drivers/input/mouse/sentelic.h
+++ b/drivers/input/mouse/sentelic.h
@@ -106,19 +106,8 @@ struct fsp_data {
106 unsigned int last_mt_fgr; /* Last seen finger(multitouch) */ 106 unsigned int last_mt_fgr; /* Last seen finger(multitouch) */
107}; 107};
108 108
109#ifdef CONFIG_MOUSE_PS2_SENTELIC
110extern int fsp_detect(struct psmouse *psmouse, bool set_properties); 109extern int fsp_detect(struct psmouse *psmouse, bool set_properties);
111extern int fsp_init(struct psmouse *psmouse); 110extern int fsp_init(struct psmouse *psmouse);
112#else
113static inline int fsp_detect(struct psmouse *psmouse, bool set_properties)
114{
115 return -ENOSYS;
116}
117static inline int fsp_init(struct psmouse *psmouse)
118{
119 return -ENOSYS;
120}
121#endif
122 111
123#endif /* __KERNEL__ */ 112#endif /* __KERNEL__ */
124 113
diff --git a/drivers/input/mouse/touchkit_ps2.h b/drivers/input/mouse/touchkit_ps2.h
index 5acb76464a5b..c808fe6c782f 100644
--- a/drivers/input/mouse/touchkit_ps2.h
+++ b/drivers/input/mouse/touchkit_ps2.h
@@ -9,14 +9,6 @@
9#ifndef _TOUCHKIT_PS2_H 9#ifndef _TOUCHKIT_PS2_H
10#define _TOUCHKIT_PS2_H 10#define _TOUCHKIT_PS2_H
11 11
12#ifdef CONFIG_MOUSE_PS2_TOUCHKIT
13int touchkit_ps2_detect(struct psmouse *psmouse, bool set_properties); 12int touchkit_ps2_detect(struct psmouse *psmouse, bool set_properties);
14#else
15static inline int touchkit_ps2_detect(struct psmouse *psmouse,
16 bool set_properties)
17{
18 return -ENOSYS;
19}
20#endif /* CONFIG_MOUSE_PS2_TOUCHKIT */
21 13
22#endif 14#endif
diff --git a/drivers/input/mouse/trackpoint.h b/drivers/input/mouse/trackpoint.h
index 77110f3ec21d..5cb93ed26085 100644
--- a/drivers/input/mouse/trackpoint.h
+++ b/drivers/input/mouse/trackpoint.h
@@ -155,14 +155,6 @@ struct trackpoint_data {
155 bool ext_dev; 155 bool ext_dev;
156}; 156};
157 157
158#ifdef CONFIG_MOUSE_PS2_TRACKPOINT
159int trackpoint_detect(struct psmouse *psmouse, bool set_properties); 158int trackpoint_detect(struct psmouse *psmouse, bool set_properties);
160#else
161static inline int trackpoint_detect(struct psmouse *psmouse,
162 bool set_properties)
163{
164 return -ENOSYS;
165}
166#endif /* CONFIG_MOUSE_PS2_TRACKPOINT */
167 159
168#endif /* _TRACKPOINT_H */ 160#endif /* _TRACKPOINT_H */
diff --git a/drivers/input/mouse/vmmouse.h b/drivers/input/mouse/vmmouse.h
index 774549a12930..90157aecade7 100644
--- a/drivers/input/mouse/vmmouse.h
+++ b/drivers/input/mouse/vmmouse.h
@@ -8,20 +8,9 @@
8#ifndef _VMMOUSE_H 8#ifndef _VMMOUSE_H
9#define _VMMOUSE_H 9#define _VMMOUSE_H
10 10
11#ifdef CONFIG_MOUSE_PS2_VMMOUSE
12#define VMMOUSE_PSNAME "VirtualPS/2" 11#define VMMOUSE_PSNAME "VirtualPS/2"
13 12
14int vmmouse_detect(struct psmouse *psmouse, bool set_properties); 13int vmmouse_detect(struct psmouse *psmouse, bool set_properties);
15int vmmouse_init(struct psmouse *psmouse); 14int vmmouse_init(struct psmouse *psmouse);
16#else
17static inline int vmmouse_detect(struct psmouse *psmouse, bool set_properties)
18{
19 return -ENOSYS;
20}
21static inline int vmmouse_init(struct psmouse *psmouse)
22{
23 return -ENOSYS;
24}
25#endif
26 15
27#endif 16#endif