]> git.baikalelectronics.ru Git - kernel.git/commit
iio: magn/ak8974: avoid unused function warning
authorArnd Bergmann <arnd@arndb.de>
Fri, 26 Aug 2016 15:31:19 +0000 (17:31 +0200)
committerJonathan Cameron <jic23@kernel.org>
Mon, 29 Aug 2016 18:54:55 +0000 (19:54 +0100)
commitb8f1a53f09e9848ba0dab10d212d96ec5eff428f
treea00081b080bdc12d27dcc11a8a931cf710f2a402
parent902e23f99053805d159765c066e6a821d2e04603
iio: magn/ak8974: avoid unused function warning

The ak8974_configure() function is used only from the PM code,
but that can be hidden when CONFIG_PM is disabled:

drivers/iio/magnetometer/ak8974.c:201:12: error: 'ak8974_configure' defined but not used [-Werror=unused-function]

This replaces the #ifdef with a __maybe_unused annotation, which
will work correctly in all configurations and avoid the warning,
as the compiler can now see where ak8974_configure is called from.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a94438ec9d4f ("iio: magn: add a driver for AK8974")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/magnetometer/ak8974.c