* [PATCH] i2c: at91: remove #define CONFIG_PM
@ 2021-07-05 12:15 Claudiu Beznea
2021-07-13 8:43 ` Codrin.Ciubotariu
2021-08-10 21:09 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Claudiu Beznea @ 2021-07-05 12:15 UTC (permalink / raw)
To: codrin.ciubotariu, nicolas.ferre, alexandre.belloni, ludovic.desroches
Cc: linux-i2c, linux-arm-kernel, linux-kernel, Claudiu Beznea
Remove #define CONFIG_PM and use __maybe_unused for PM functions and
pm_ptr() for PM ops.
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
drivers/i2c/busses/i2c-at91-core.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/i2c/busses/i2c-at91-core.c b/drivers/i2c/busses/i2c-at91-core.c
index e14edd236108..9f3c3e8e8011 100644
--- a/drivers/i2c/busses/i2c-at91-core.c
+++ b/drivers/i2c/busses/i2c-at91-core.c
@@ -286,9 +286,7 @@ static int at91_twi_remove(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-
-static int at91_twi_runtime_suspend(struct device *dev)
+static int __maybe_unused at91_twi_runtime_suspend(struct device *dev)
{
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
@@ -299,7 +297,7 @@ static int at91_twi_runtime_suspend(struct device *dev)
return 0;
}
-static int at91_twi_runtime_resume(struct device *dev)
+static int __maybe_unused at91_twi_runtime_resume(struct device *dev)
{
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
@@ -308,7 +306,7 @@ static int at91_twi_runtime_resume(struct device *dev)
return clk_prepare_enable(twi_dev->clk);
}
-static int at91_twi_suspend_noirq(struct device *dev)
+static int __maybe_unused at91_twi_suspend_noirq(struct device *dev)
{
if (!pm_runtime_status_suspended(dev))
at91_twi_runtime_suspend(dev);
@@ -316,7 +314,7 @@ static int at91_twi_suspend_noirq(struct device *dev)
return 0;
}
-static int at91_twi_resume_noirq(struct device *dev)
+static int __maybe_unused at91_twi_resume_noirq(struct device *dev)
{
struct at91_twi_dev *twi_dev = dev_get_drvdata(dev);
int ret;
@@ -342,11 +340,6 @@ static const struct dev_pm_ops at91_twi_pm = {
.runtime_resume = at91_twi_runtime_resume,
};
-#define at91_twi_pm_ops (&at91_twi_pm)
-#else
-#define at91_twi_pm_ops NULL
-#endif
-
static struct platform_driver at91_twi_driver = {
.probe = at91_twi_probe,
.remove = at91_twi_remove,
@@ -354,7 +347,7 @@ static struct platform_driver at91_twi_driver = {
.driver = {
.name = "at91_i2c",
.of_match_table = of_match_ptr(atmel_twi_dt_ids),
- .pm = at91_twi_pm_ops,
+ .pm = pm_ptr(&at91_twi_pm),
},
};
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: at91: remove #define CONFIG_PM
2021-07-05 12:15 [PATCH] i2c: at91: remove #define CONFIG_PM Claudiu Beznea
@ 2021-07-13 8:43 ` Codrin.Ciubotariu
2021-08-10 21:09 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Codrin.Ciubotariu @ 2021-07-13 8:43 UTC (permalink / raw)
To: Claudiu.Beznea, Nicolas.Ferre, alexandre.belloni, Ludovic.Desroches
Cc: linux-i2c, linux-arm-kernel, linux-kernel
On 05.07.2021 15:15, Claudiu Beznea wrote:
> Remove #define CONFIG_PM and use __maybe_unused for PM functions and
> pm_ptr() for PM ops.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Thanks!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: at91: remove #define CONFIG_PM
2021-07-05 12:15 [PATCH] i2c: at91: remove #define CONFIG_PM Claudiu Beznea
2021-07-13 8:43 ` Codrin.Ciubotariu
@ 2021-08-10 21:09 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-08-10 21:09 UTC (permalink / raw)
To: Claudiu Beznea
Cc: alexandre.belloni, linux-kernel, ludovic.desroches, linux-i2c,
codrin.ciubotariu, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 263 bytes --]
On Mon, Jul 05, 2021 at 03:15:16PM +0300, Claudiu Beznea wrote:
> Remove #define CONFIG_PM and use __maybe_unused for PM functions and
> pm_ptr() for PM ops.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Applied to for-next, thanks!
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-08-10 21:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-05 12:15 [PATCH] i2c: at91: remove #define CONFIG_PM Claudiu Beznea
2021-07-13 8:43 ` Codrin.Ciubotariu
2021-08-10 21:09 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).