Skip to content

Commit

Permalink
hwrng: atmel - use __maybe_unused and pm_ptr() for pm ops
Browse files Browse the repository at this point in the history
Use __maybe_unused and pm_ptr() for pm ops.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Claudiu Beznea authored and Herbert Xu committed Mar 2, 2022
1 parent 9fbd8b3 commit b953188
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/char/hw_random/atmel-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ static int atmel_trng_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int atmel_trng_suspend(struct device *dev)
static int __maybe_unused atmel_trng_suspend(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);

Expand All @@ -165,18 +164,17 @@ static int atmel_trng_suspend(struct device *dev)
return 0;
}

static int atmel_trng_resume(struct device *dev)
static int __maybe_unused atmel_trng_resume(struct device *dev)
{
struct atmel_trng *trng = dev_get_drvdata(dev);

return atmel_trng_init(trng);
}

static const struct dev_pm_ops atmel_trng_pm_ops = {
static const struct dev_pm_ops __maybe_unused atmel_trng_pm_ops = {
.suspend = atmel_trng_suspend,
.resume = atmel_trng_resume,
};
#endif /* CONFIG_PM */

static const struct atmel_trng_data at91sam9g45_config = {
.has_half_rate = false,
Expand Down Expand Up @@ -204,9 +202,7 @@ static struct platform_driver atmel_trng_driver = {
.remove = atmel_trng_remove,
.driver = {
.name = "atmel-trng",
#ifdef CONFIG_PM
.pm = &atmel_trng_pm_ops,
#endif /* CONFIG_PM */
.pm = pm_ptr(&atmel_trng_pm_ops),
.of_match_table = atmel_trng_dt_ids,
},
};
Expand Down

0 comments on commit b953188

Please sign in to comment.