Skip to content

Commit

Permalink
Input: psmouse - drop all unneeded functions from mouse headers
Browse files Browse the repository at this point in the history
Recently we had a building error if we enable the MOUSE_PS2_ALPS while
disable the MOUSE_PS2_TRACKPOINT, and was fixed by 49e6979
("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 <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
jason77-wang authored and dtor committed Aug 20, 2019
1 parent e95656e commit cfd8579
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 114 deletions.
11 changes: 0 additions & 11 deletions drivers/input/mouse/alps.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 0 additions & 11 deletions drivers/input/mouse/byd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions drivers/input/mouse/cypress_ps2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
18 changes: 2 additions & 16 deletions drivers/input/mouse/elantech.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 3 additions & 10 deletions drivers/input/mouse/hgpk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 3 additions & 10 deletions drivers/input/mouse/lifebook.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 0 additions & 7 deletions drivers/input/mouse/logips2pp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 0 additions & 11 deletions drivers/input/mouse/sentelic.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

Expand Down
8 changes: 0 additions & 8 deletions drivers/input/mouse/touchkit_ps2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 0 additions & 8 deletions drivers/input/mouse/trackpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
11 changes: 0 additions & 11 deletions drivers/input/mouse/vmmouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cfd8579

Please sign in to comment.