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

iio: light: cm3605: mark PM functions as __maybe_unused

When CONFIG_PM_SLEEP is disabled, we get a harmless warning

drivers/iio/light/cm3605.c:292:12: error: 'cm3605_pm_resume' defined but not used [-Werror=unused-function]
drivers/iio/light/cm3605.c:281:12: error: 'cm3605_pm_suspend' defined but not used [-Werror=unused-function]

Marking the functions as possibly unused avoids the warning without
needing to add an #ifdef.

Fixes: 8afa505c1230 ("iio: light: add driver for Capella CM3605")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

authored by

Arnd Bergmann and committed by
Jonathan Cameron
d1242acc 3bc1abcd

+2 -2
+2 -2
drivers/iio/light/cm3605.c
··· 278 278 return 0; 279 279 } 280 280 281 - static int cm3605_pm_suspend(struct device *dev) 281 + static int __maybe_unused cm3605_pm_suspend(struct device *dev) 282 282 { 283 283 struct iio_dev *indio_dev = dev_get_drvdata(dev); 284 284 struct cm3605 *cm3605 = iio_priv(indio_dev); ··· 289 289 return 0; 290 290 } 291 291 292 - static int cm3605_pm_resume(struct device *dev) 292 + static int __maybe_unused cm3605_pm_resume(struct device *dev) 293 293 { 294 294 struct iio_dev *indio_dev = dev_get_drvdata(dev); 295 295 struct cm3605 *cm3605 = iio_priv(indio_dev);