diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-03-02 10:58:59 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2016-03-11 08:19:18 -0500 |
commit | b93f342da1766ef1740e6277508329356c4ea48b (patch) | |
tree | 2b0149746444e693dfab64aa22ba9aef88044d9a | |
parent | ea0375afa17281e9e0190034215d0404dbad7449 (diff) |
hwrng: exynos - use __maybe_unused to hide pm functions
The exynos random driver uses #ifdef to check for CONFIG_PM, but
then uses SIMPLE_DEV_PM_OPS, which leaves the references out when
CONFIG_PM_SLEEP is not defined, so we get a warning with
PM=y && PM_SLEEP=n:
drivers/char/hw_random/exynos-rng.c:166:12: error: 'exynos_rng_suspend' defined but not used [-Werror=unused-function]
drivers/char/hw_random/exynos-rng.c:171:12: error: 'exynos_rng_resume' defined but not used [-Werror=unused-function]
This removes the incorrect #ifdef and instead uses a __maybe_unused
annotation to let the compiler know it can silently drop
the function definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/char/hw_random/exynos-rng.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/char/hw_random/exynos-rng.c b/drivers/char/hw_random/exynos-rng.c index 30cf4623184f..ada081232528 100644 --- a/drivers/char/hw_random/exynos-rng.c +++ b/drivers/char/hw_random/exynos-rng.c | |||
@@ -144,8 +144,7 @@ static int exynos_rng_probe(struct platform_device *pdev) | |||
144 | return devm_hwrng_register(&pdev->dev, &exynos_rng->rng); | 144 | return devm_hwrng_register(&pdev->dev, &exynos_rng->rng); |
145 | } | 145 | } |
146 | 146 | ||
147 | #ifdef CONFIG_PM | 147 | static int __maybe_unused exynos_rng_runtime_suspend(struct device *dev) |
148 | static int exynos_rng_runtime_suspend(struct device *dev) | ||
149 | { | 148 | { |
150 | struct platform_device *pdev = to_platform_device(dev); | 149 | struct platform_device *pdev = to_platform_device(dev); |
151 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); | 150 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); |
@@ -155,7 +154,7 @@ static int exynos_rng_runtime_suspend(struct device *dev) | |||
155 | return 0; | 154 | return 0; |
156 | } | 155 | } |
157 | 156 | ||
158 | static int exynos_rng_runtime_resume(struct device *dev) | 157 | static int __maybe_unused exynos_rng_runtime_resume(struct device *dev) |
159 | { | 158 | { |
160 | struct platform_device *pdev = to_platform_device(dev); | 159 | struct platform_device *pdev = to_platform_device(dev); |
161 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); | 160 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); |
@@ -163,12 +162,12 @@ static int exynos_rng_runtime_resume(struct device *dev) | |||
163 | return clk_prepare_enable(exynos_rng->clk); | 162 | return clk_prepare_enable(exynos_rng->clk); |
164 | } | 163 | } |
165 | 164 | ||
166 | static int exynos_rng_suspend(struct device *dev) | 165 | static int __maybe_unused exynos_rng_suspend(struct device *dev) |
167 | { | 166 | { |
168 | return pm_runtime_force_suspend(dev); | 167 | return pm_runtime_force_suspend(dev); |
169 | } | 168 | } |
170 | 169 | ||
171 | static int exynos_rng_resume(struct device *dev) | 170 | static int __maybe_unused exynos_rng_resume(struct device *dev) |
172 | { | 171 | { |
173 | struct platform_device *pdev = to_platform_device(dev); | 172 | struct platform_device *pdev = to_platform_device(dev); |
174 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); | 173 | struct exynos_rng *exynos_rng = platform_get_drvdata(pdev); |
@@ -180,7 +179,6 @@ static int exynos_rng_resume(struct device *dev) | |||
180 | 179 | ||
181 | return exynos_rng_configure(exynos_rng); | 180 | return exynos_rng_configure(exynos_rng); |
182 | } | 181 | } |
183 | #endif | ||
184 | 182 | ||
185 | static const struct dev_pm_ops exynos_rng_pm_ops = { | 183 | static const struct dev_pm_ops exynos_rng_pm_ops = { |
186 | SET_SYSTEM_SLEEP_PM_OPS(exynos_rng_suspend, exynos_rng_resume) | 184 | SET_SYSTEM_SLEEP_PM_OPS(exynos_rng_suspend, exynos_rng_resume) |