Skip to content

Commit

Permalink
hwrng: omap - remove #ifdefery around PM methods
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov authored and Herbert Xu committed Mar 12, 2015
1 parent f1e866b commit a308d66
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions drivers/char/hw_random/omap-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ static int omap_rng_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM_SLEEP

static int omap_rng_suspend(struct device *dev)
static int __maybe_unused omap_rng_suspend(struct device *dev)
{
struct omap_rng_dev *priv = dev_get_drvdata(dev);

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

static int omap_rng_resume(struct device *dev)
static int __maybe_unused omap_rng_resume(struct device *dev)
{
struct omap_rng_dev *priv = dev_get_drvdata(dev);

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

static SIMPLE_DEV_PM_OPS(omap_rng_pm, omap_rng_suspend, omap_rng_resume);
#define OMAP_RNG_PM (&omap_rng_pm)

#else

#define OMAP_RNG_PM NULL

#endif

static struct platform_driver omap_rng_driver = {
.driver = {
.name = "omap_rng",
.pm = OMAP_RNG_PM,
.pm = &omap_rng_pm,
.of_match_table = of_match_ptr(omap_rng_of_match),
},
.probe = omap_rng_probe,
Expand Down

0 comments on commit a308d66

Please sign in to comment.