Skip to content

Commit a308d66

Browse files
dtorherbertx
authored andcommitted
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>
1 parent f1e866b commit a308d66

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

drivers/char/hw_random/omap-rng.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev)
422422
return 0;
423423
}
424424

425-
#ifdef CONFIG_PM_SLEEP
426-
427-
static int omap_rng_suspend(struct device *dev)
425+
static int __maybe_unused omap_rng_suspend(struct device *dev)
428426
{
429427
struct omap_rng_dev *priv = dev_get_drvdata(dev);
430428

@@ -434,7 +432,7 @@ static int omap_rng_suspend(struct device *dev)
434432
return 0;
435433
}
436434

437-
static int omap_rng_resume(struct device *dev)
435+
static int __maybe_unused omap_rng_resume(struct device *dev)
438436
{
439437
struct omap_rng_dev *priv = dev_get_drvdata(dev);
440438

@@ -445,18 +443,11 @@ static int omap_rng_resume(struct device *dev)
445443
}
446444

447445
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
455446

456447
static struct platform_driver omap_rng_driver = {
457448
.driver = {
458449
.name = "omap_rng",
459-
.pm = OMAP_RNG_PM,
450+
.pm = &omap_rng_pm,
460451
.of_match_table = of_match_ptr(omap_rng_of_match),
461452
},
462453
.probe = omap_rng_probe,

0 commit comments

Comments
 (0)