]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: ste_rmi4: avoid unused function warnings
authorArnd Bergmann <arnd@arndb.de>
Fri, 20 Nov 2015 21:59:14 +0000 (22:59 +0100)
committerSasha Levin <alexander.levin@microsoft.com>
Sun, 4 Mar 2018 15:28:29 +0000 (10:28 -0500)
commit966fe0a5175e77802b452bdacb28ab72b74f4a4b
tree3d1698d108218f3dedc874496eb20dbf88ee5785
parentfe18e13367ea53808de8f914ab7326326bf8e403
staging: ste_rmi4: avoid unused function warnings

[ Upstream commit 9045a4a7e686a6316129d6d0b21b4fe2520968e4 ]

The rmi4 touchscreen driver encloses the power-management
functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume
functions are only really used when CONFIG_PM_SLEEP is also
set, as a frequent gcc warning shows:

ste_rmi4/synaptics_i2c_rmi4.c:1050:12: warning: 'synaptics_rmi4_suspend' defined but not used
ste_rmi4/synaptics_i2c_rmi4.c:1084:12: warning: 'synaptics_rmi4_resume' defined but not used

This changes the driver to remove the #ifdef and instead mark
the functions as __maybe_unused, which is a nicer anyway, as it
provides build testing for all the code in all configurations
and is harder to get wrong.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/staging/ste_rmi4/synaptics_i2c_rmi4.c