diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-08-26 11:31:19 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-29 14:54:55 -0400 |
commit | 5bc55ef31f710326f541e6a3c726526815dd48e6 (patch) | |
tree | a00081b080bdc12d27dcc11a8a931cf710f2a402 | |
parent | 2e1f44d8a7724e889f1a4f211aad13320cb80f1f (diff) |
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: 7c94a8b2ee8c ("iio: magn: add a driver for AK8974")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r-- | drivers/iio/magnetometer/ak8974.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/magnetometer/ak8974.c b/drivers/iio/magnetometer/ak8974.c index e70e4e22b72c..12bd17b4cf58 100644 --- a/drivers/iio/magnetometer/ak8974.c +++ b/drivers/iio/magnetometer/ak8974.c | |||
@@ -783,8 +783,7 @@ static int __exit ak8974_remove(struct i2c_client *i2c) | |||
783 | return 0; | 783 | return 0; |
784 | } | 784 | } |
785 | 785 | ||
786 | #ifdef CONFIG_PM | 786 | static int __maybe_unused ak8974_runtime_suspend(struct device *dev) |
787 | static int ak8974_runtime_suspend(struct device *dev) | ||
788 | { | 787 | { |
789 | struct ak8974 *ak8974 = | 788 | struct ak8974 *ak8974 = |
790 | iio_priv(i2c_get_clientdata(to_i2c_client(dev))); | 789 | iio_priv(i2c_get_clientdata(to_i2c_client(dev))); |
@@ -795,7 +794,7 @@ static int ak8974_runtime_suspend(struct device *dev) | |||
795 | return 0; | 794 | return 0; |
796 | } | 795 | } |
797 | 796 | ||
798 | static int ak8974_runtime_resume(struct device *dev) | 797 | static int __maybe_unused ak8974_runtime_resume(struct device *dev) |
799 | { | 798 | { |
800 | struct ak8974 *ak8974 = | 799 | struct ak8974 *ak8974 = |
801 | iio_priv(i2c_get_clientdata(to_i2c_client(dev))); | 800 | iio_priv(i2c_get_clientdata(to_i2c_client(dev))); |
@@ -822,7 +821,6 @@ out_regulator_disable: | |||
822 | 821 | ||
823 | return ret; | 822 | return ret; |
824 | } | 823 | } |
825 | #endif /* CONFIG_PM */ | ||
826 | 824 | ||
827 | static const struct dev_pm_ops ak8974_dev_pm_ops = { | 825 | static const struct dev_pm_ops ak8974_dev_pm_ops = { |
828 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, | 826 | SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, |