* [PATCH 1/2] watchdog: imx2_wdt: Remove __maybe_unused notations
@ 2024-08-09 2:08 Fabio Estevam
2024-08-09 2:08 ` [PATCH 2/2] watchdog: imx_sc_wdt: " Fabio Estevam
2024-08-09 3:15 ` [PATCH 1/2] watchdog: imx2_wdt: " Guenter Roeck
0 siblings, 2 replies; 4+ messages in thread
From: Fabio Estevam @ 2024-08-09 2:08 UTC (permalink / raw)
To: linux; +Cc: wim, linux-watchdog, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to
handle the .suspend/.resume callbacks.
These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use __maybe_unused notation.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
drivers/watchdog/imx2_wdt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
index 42e8ffae18dd..4b3a192ee3e8 100644
--- a/drivers/watchdog/imx2_wdt.c
+++ b/drivers/watchdog/imx2_wdt.c
@@ -379,7 +379,7 @@ static void imx2_wdt_shutdown(struct platform_device *pdev)
}
/* Disable watchdog if it is active or non-active but still running */
-static int __maybe_unused imx2_wdt_suspend(struct device *dev)
+static int imx2_wdt_suspend(struct device *dev)
{
struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
@@ -404,7 +404,7 @@ static int __maybe_unused imx2_wdt_suspend(struct device *dev)
}
/* Enable watchdog and configure it if necessary */
-static int __maybe_unused imx2_wdt_resume(struct device *dev)
+static int imx2_wdt_resume(struct device *dev)
{
struct watchdog_device *wdog = dev_get_drvdata(dev);
struct imx2_wdt_device *wdev = watchdog_get_drvdata(wdog);
@@ -435,8 +435,8 @@ static int __maybe_unused imx2_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
- imx2_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imx2_wdt_pm_ops, imx2_wdt_suspend,
+ imx2_wdt_resume);
static struct imx2_wdt_data imx_wdt = {
.wdw_supported = true,
@@ -476,7 +476,7 @@ static struct platform_driver imx2_wdt_driver = {
.shutdown = imx2_wdt_shutdown,
.driver = {
.name = DRIVER_NAME,
- .pm = &imx2_wdt_pm_ops,
+ .pm = pm_sleep_ptr(&imx2_wdt_pm_ops),
.of_match_table = imx2_wdt_dt_ids,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] watchdog: imx_sc_wdt: Remove __maybe_unused notations
2024-08-09 2:08 [PATCH 1/2] watchdog: imx2_wdt: Remove __maybe_unused notations Fabio Estevam
@ 2024-08-09 2:08 ` Fabio Estevam
2024-08-09 3:15 ` Guenter Roeck
2024-08-09 3:15 ` [PATCH 1/2] watchdog: imx2_wdt: " Guenter Roeck
1 sibling, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2024-08-09 2:08 UTC (permalink / raw)
To: linux; +Cc: wim, linux-watchdog, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to
handle the .suspend/.resume callbacks.
These macros allow the suspend and resume functions to be automatically
dropped by the compiler when CONFIG_SUSPEND is disabled, without having
to use __maybe_unused notation.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
drivers/watchdog/imx_sc_wdt.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
index e51fe1b78518..efd492b122f4 100644
--- a/drivers/watchdog/imx_sc_wdt.c
+++ b/drivers/watchdog/imx_sc_wdt.c
@@ -216,7 +216,7 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
return devm_watchdog_register_device(dev, wdog);
}
-static int __maybe_unused imx_sc_wdt_suspend(struct device *dev)
+static int imx_sc_wdt_suspend(struct device *dev)
{
struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev);
@@ -226,7 +226,7 @@ static int __maybe_unused imx_sc_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused imx_sc_wdt_resume(struct device *dev)
+static int imx_sc_wdt_resume(struct device *dev)
{
struct imx_sc_wdt_device *imx_sc_wdd = dev_get_drvdata(dev);
@@ -236,8 +236,8 @@ static int __maybe_unused imx_sc_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(imx_sc_wdt_pm_ops,
- imx_sc_wdt_suspend, imx_sc_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(imx_sc_wdt_pm_ops, imx_sc_wdt_suspend,
+ imx_sc_wdt_resume);
static const struct of_device_id imx_sc_wdt_dt_ids[] = {
{ .compatible = "fsl,imx-sc-wdt", },
@@ -250,7 +250,7 @@ static struct platform_driver imx_sc_wdt_driver = {
.driver = {
.name = "imx-sc-wdt",
.of_match_table = imx_sc_wdt_dt_ids,
- .pm = &imx_sc_wdt_pm_ops,
+ .pm = pm_sleep_ptr(&imx_sc_wdt_pm_ops),
},
};
module_platform_driver(imx_sc_wdt_driver);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] watchdog: imx_sc_wdt: Remove __maybe_unused notations
2024-08-09 2:08 ` [PATCH 2/2] watchdog: imx_sc_wdt: " Fabio Estevam
@ 2024-08-09 3:15 ` Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-08-09 3:15 UTC (permalink / raw)
To: Fabio Estevam; +Cc: wim, linux-watchdog, Fabio Estevam
On Thu, Aug 08, 2024 at 11:08:22PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
>
> Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to
> handle the .suspend/.resume callbacks.
>
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use __maybe_unused notation.
>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] watchdog: imx2_wdt: Remove __maybe_unused notations
2024-08-09 2:08 [PATCH 1/2] watchdog: imx2_wdt: Remove __maybe_unused notations Fabio Estevam
2024-08-09 2:08 ` [PATCH 2/2] watchdog: imx_sc_wdt: " Fabio Estevam
@ 2024-08-09 3:15 ` Guenter Roeck
1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2024-08-09 3:15 UTC (permalink / raw)
To: Fabio Estevam; +Cc: wim, linux-watchdog, Fabio Estevam
On Thu, Aug 08, 2024 at 11:08:21PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
>
> Use the DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() macros to
> handle the .suspend/.resume callbacks.
>
> These macros allow the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_SUSPEND is disabled, without having
> to use __maybe_unused notation.
>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-09 3:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 2:08 [PATCH 1/2] watchdog: imx2_wdt: Remove __maybe_unused notations Fabio Estevam
2024-08-09 2:08 ` [PATCH 2/2] watchdog: imx_sc_wdt: " Fabio Estevam
2024-08-09 3:15 ` Guenter Roeck
2024-08-09 3:15 ` [PATCH 1/2] watchdog: imx2_wdt: " Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox