]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: cmos: avoid unused function warning
authorArnd Bergmann <arnd@arndb.de>
Thu, 22 Sep 2016 09:48:00 +0000 (11:48 +0200)
committerAlexandre Belloni <alexandre.belloni@free-electrons.com>
Thu, 22 Sep 2016 12:23:29 +0000 (14:23 +0200)
commit6ca4f97631a06a296bbbc27919d88fe56e9fb84f
tree1173c1be92f3026c3f7acff941bb6e23aa661d2a
parent0ffa93e07a07f3df2c856d7924743bb81c09f900
rtc: cmos: avoid unused function warning

A bug fix for the ACPI side of this driver caused a harmless
build warning:

drivers/rtc/rtc-cmos.c:1115:13: error: 'cmos_check_acpi_rtc_status' defined but not used [-Werror=unused-function]
 static void cmos_check_acpi_rtc_status(struct device *dev,

We can avoid the warning and simplify the driver at the same time
by removing the #ifdef for CONFIG_PM and rely on the SIMPLE_DEV_PM_OPS()
to set everything up correctly. cmos_resume() has to get marked
as __maybe_unused so we don't introduce another warning, and
the two variants of cmos_poweroff() can get merged into one using
an IS_ENABLED() check.

Fixes: e5950d1459b4 ("rtc: cmos: Clear ACPI-driven alarms upon resume")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
drivers/rtc/rtc-cmos.c