From: Claudiu Beznea <claudiu.beznea@microchip.com> To: <mpm@selenic.com>, <herbert@gondor.apana.org.au>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com> Cc: <linux-arm-kernel@lists.infradead.org>, <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Claudiu Beznea <claudiu.beznea@microchip.com> Subject: [PATCH v2 5/7] hwrng: atmel - use __maybe_unused and pm_ptr() for pm ops Date: Mon, 21 Feb 2022 09:59:26 +0200 [thread overview] Message-ID: <20220221075928.563806-6-claudiu.beznea@microchip.com> (raw) In-Reply-To: <20220221075928.563806-1-claudiu.beznea@microchip.com> Use __maybe_unused and pm_ptr() for pm ops. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> --- drivers/char/hw_random/atmel-rng.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index ef49dbe681cf..0fff74808472 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c @@ -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); @@ -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, @@ -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, }, }; -- 2.32.0
WARNING: multiple messages have this Message-ID (diff)
From: Claudiu Beznea <claudiu.beznea@microchip.com> To: <mpm@selenic.com>, <herbert@gondor.apana.org.au>, <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com> Cc: <linux-arm-kernel@lists.infradead.org>, <linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Claudiu Beznea <claudiu.beznea@microchip.com> Subject: [PATCH v2 5/7] hwrng: atmel - use __maybe_unused and pm_ptr() for pm ops Date: Mon, 21 Feb 2022 09:59:26 +0200 [thread overview] Message-ID: <20220221075928.563806-6-claudiu.beznea@microchip.com> (raw) In-Reply-To: <20220221075928.563806-1-claudiu.beznea@microchip.com> Use __maybe_unused and pm_ptr() for pm ops. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> --- drivers/char/hw_random/atmel-rng.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c index ef49dbe681cf..0fff74808472 100644 --- a/drivers/char/hw_random/atmel-rng.c +++ b/drivers/char/hw_random/atmel-rng.c @@ -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); @@ -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, @@ -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, }, }; -- 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-21 7:58 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-02-21 7:59 [PATCH v2 0/7] hwrng: atmel - add runtime pm support Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 1/7] hwrng: atmel - add wait for ready support on read Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 2/7] hwrng: atmel - disable trng on failure path Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 3/7] hwrng: atmel - rename enable/disable functions to init/cleanup Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 4/7] hwrng: atmel - move set of TRNG_HALFR in atmel_trng_init() Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea [this message] 2022-02-21 7:59 ` [PATCH v2 5/7] hwrng: atmel - use __maybe_unused and pm_ptr() for pm ops Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 6/7] hwrng: atmel - add runtime pm support Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 7:59 ` [PATCH v2 7/7] hwrng: atmel - remove extra line Claudiu Beznea 2022-02-21 7:59 ` Claudiu Beznea 2022-02-21 10:50 ` [PATCH v2 0/7] hwrng: atmel - add runtime pm support Claudiu.Beznea 2022-02-21 10:50 ` Claudiu.Beznea 2022-03-02 22:57 ` Herbert Xu 2022-03-02 22:57 ` Herbert Xu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220221075928.563806-6-claudiu.beznea@microchip.com \ --to=claudiu.beznea@microchip.com \ --cc=alexandre.belloni@bootlin.com \ --cc=herbert@gondor.apana.org.au \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-crypto@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=mpm@selenic.com \ --cc=nicolas.ferre@microchip.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.