Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: exynos-lpass: Mark PM functions as __maybe_unused

The newly added exynos lpass driver produces a build warning when
CONFIG_PM is disabled since the only callers of exynos_lpass_disable
are under an #ifdef:

drivers/mfd/exynos-lpass.c:93:13: error: 'exynos_lpass_disable' defined but not used [-Werror=unused-function]
static void exynos_lpass_disable(struct exynos_lpass *lpass)

This removes the #ifdef and replaces it with __maybe_unused annotations
so the compiler can leave out the unused code silently with less
room for mistakes.

Fixes: 36c26760bba8 ("mfd: Add Samsung Exynos Low Power Audio Subsystem driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Arnd Bergmann and committed by
Lee Jones
22a96b85 c50cdd62

+2 -4
+2 -4
drivers/mfd/exynos-lpass.c
··· 144 144 return of_platform_populate(dev->of_node, NULL, NULL, dev); 145 145 } 146 146 147 - #ifdef CONFIG_PM_SLEEP 148 - static int exynos_lpass_suspend(struct device *dev) 147 + static int __maybe_unused exynos_lpass_suspend(struct device *dev) 149 148 { 150 149 struct exynos_lpass *lpass = dev_get_drvdata(dev); 151 150 ··· 153 154 return 0; 154 155 } 155 156 156 - static int exynos_lpass_resume(struct device *dev) 157 + static int __maybe_unused exynos_lpass_resume(struct device *dev) 157 158 { 158 159 struct exynos_lpass *lpass = dev_get_drvdata(dev); 159 160 ··· 161 162 162 163 return 0; 163 164 } 164 - #endif 165 165 166 166 static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend, 167 167 exynos_lpass_resume);