diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-03-11 17:08:36 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-03-12 06:13:37 -0400 |
commit | a308d66f144c9d5a305ceda4345bebbaf6abc43f (patch) | |
tree | 80aa913c50c904a01eb9d251c70d301c615c7be3 /drivers/char/hw_random/omap-rng.c | |
parent | f1e866b10676faf8b9092cb821a9ac8acf31dbd8 (diff) |
hwrng: omap - remove #ifdefery around PM methods
Instead of using #ifdefs let's mark suspend and resume methods as
__maybe_unused which will suppress compiler warnings about them being
unused and provide better compile coverage.
Because SIMPLE_DEV_PM_OPS() produces an empty omap_rng_pm structure in
case of !CONFIG_PM_SLEEP neither omap_rng_suspend nor omap_rng_resume
will end up being referenced and the change will not result in
increasing image size.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/char/hw_random/omap-rng.c')
-rw-r--r-- | drivers/char/hw_random/omap-rng.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c index 7f3597d2a8ac..5c171b18559f 100644 --- a/drivers/char/hw_random/omap-rng.c +++ b/drivers/char/hw_random/omap-rng.c | |||
@@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev) | |||
422 | return 0; | 422 | return 0; |
423 | } | 423 | } |
424 | 424 | ||
425 | #ifdef CONFIG_PM_SLEEP | 425 | static int __maybe_unused omap_rng_suspend(struct device *dev) |
426 | |||
427 | static int omap_rng_suspend(struct device *dev) | ||
428 | { | 426 | { |
429 | struct omap_rng_dev *priv = dev_get_drvdata(dev); | 427 | struct omap_rng_dev *priv = dev_get_drvdata(dev); |
430 | 428 | ||
@@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev) | |||
434 | return 0; | 432 | return 0; |
435 | } | 433 | } |
436 | 434 | ||
437 | static int omap_rng_resume(struct device *dev) | 435 | static int __maybe_unused omap_rng_resume(struct device *dev) |
438 | { | 436 | { |
439 | struct omap_rng_dev *priv = dev_get_drvdata(dev); | 437 | struct omap_rng_dev *priv = dev_get_drvdata(dev); |
440 | 438 | ||
@@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev) | |||
445 | } | 443 | } |
446 | 444 | ||
447 | static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); | 445 | static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume); |
448 | #define OMAP_RNG_PM (&omap_rng_pm) | ||
449 | |||
450 | #else | ||
451 | |||
452 | #define OMAP_RNG_PM NULL | ||
453 | |||
454 | #endif | ||
455 | 446 | ||
456 | static struct platform_driver omap_rng_driver = { | 447 | static struct platform_driver omap_rng_driver = { |
457 | .driver = { | 448 | .driver = { |
458 | .name = "omap_rng", | 449 | .name = "omap_rng", |
459 | .pm = OMAP_RNG_PM, | 450 | .pm = &omap_rng_pm, |
460 | .of_match_table = of_match_ptr(omap_rng_of_match), | 451 | .of_match_table = of_match_ptr(omap_rng_of_match), |
461 | }, | 452 | }, |
462 | .probe = omap_rng_probe, | 453 | .probe = omap_rng_probe, |