* [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-09-14 8:54 Triet Hoang
2026-09-14 8:54 ` [PATCH v2 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
` (7 more replies)
0 siblings, 8 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
This series converts the watchdog drivers to use DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This is a straightforward cleanup with no functional change intended.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
Link to v1: https://lore.kernel.org/all/20260826060839.203297-1-triet.hoang.dev@gmail.com/
Changes in v2:
- Use pm_ptr() instead of pm_sleep_ptr()
- Align formatting of DEFINE_SIMPLE_DEV_PM_OPS() usage
---
Triet Hoang (8):
watchdog: cadence_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: da9062: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: keembay_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: msc313e_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: of_xilinx_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: pm8916_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: sp805_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
watchdog: stmp3xxx_rtc_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
drivers/watchdog/cadence_wdt.c | 8 ++++----
drivers/watchdog/da9062_wdt.c | 9 ++++-----
drivers/watchdog/keembay_wdt.c | 9 ++++-----
drivers/watchdog/msc313e_wdt.c | 8 ++++----
drivers/watchdog/of_xilinx_wdt.c | 8 ++++----
drivers/watchdog/pm8916_wdt.c | 9 ++++-----
drivers/watchdog/sp805_wdt.c | 9 ++++-----
drivers/watchdog/stmp3xxx_rtc_wdt.c | 9 ++++-----
8 files changed, 32 insertions(+), 37 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/8] watchdog: cadence_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-16 3:28 ` Tzung-Bi Shih
2026-09-14 8:54 ` [PATCH v2 2/8] watchdog: da9062: " Triet Hoang
` (6 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/cadence_wdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/cadence_wdt.c b/drivers/watchdog/cadence_wdt.c
index ad46b33ce5f2..94e74f451c7e 100644
--- a/drivers/watchdog/cadence_wdt.c
+++ b/drivers/watchdog/cadence_wdt.c
@@ -359,7 +359,7 @@ static int cdns_wdt_probe(struct platform_device *pdev)
* @dev: handle to the device structure.
* Return: 0 always.
*/
-static int __maybe_unused cdns_wdt_suspend(struct device *dev)
+static int cdns_wdt_suspend(struct device *dev)
{
struct cdns_wdt *wdt = dev_get_drvdata(dev);
@@ -377,7 +377,7 @@ static int __maybe_unused cdns_wdt_suspend(struct device *dev)
* @dev: handle to the device structure.
* Return: 0 on success, errno otherwise.
*/
-static int __maybe_unused cdns_wdt_resume(struct device *dev)
+static int cdns_wdt_resume(struct device *dev)
{
int ret;
struct cdns_wdt *wdt = dev_get_drvdata(dev);
@@ -394,7 +394,7 @@ static int __maybe_unused cdns_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(cdns_wdt_pm_ops, cdns_wdt_suspend, cdns_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cdns_wdt_pm_ops, cdns_wdt_suspend, cdns_wdt_resume);
static const struct of_device_id cdns_wdt_of_match[] = {
{ .compatible = "cdns,wdt-r1p2", },
@@ -408,7 +408,7 @@ static struct platform_driver cdns_wdt_driver = {
.driver = {
.name = "cdns-wdt",
.of_match_table = cdns_wdt_of_match,
- .pm = &cdns_wdt_pm_ops,
+ .pm = pm_ptr(&cdns_wdt_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/8] watchdog: da9062: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-09-14 8:54 ` [PATCH v2 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 3/8] watchdog: keembay_wdt: " Triet Hoang
` (5 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/da9062_wdt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c
index 426962547df1..95585dffba6d 100644
--- a/drivers/watchdog/da9062_wdt.c
+++ b/drivers/watchdog/da9062_wdt.c
@@ -248,7 +248,7 @@ static int da9062_wdt_probe(struct platform_device *pdev)
return devm_watchdog_register_device(dev, &wdt->wdtdev);
}
-static int __maybe_unused da9062_wdt_suspend(struct device *dev)
+static int da9062_wdt_suspend(struct device *dev)
{
struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
@@ -262,7 +262,7 @@ static int __maybe_unused da9062_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused da9062_wdt_resume(struct device *dev)
+static int da9062_wdt_resume(struct device *dev)
{
struct watchdog_device *wdd = dev_get_drvdata(dev);
struct da9062_watchdog *wdt = watchdog_get_drvdata(wdd);
@@ -276,14 +276,13 @@ static int __maybe_unused da9062_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(da9062_wdt_pm_ops,
- da9062_wdt_suspend, da9062_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(da9062_wdt_pm_ops, da9062_wdt_suspend, da9062_wdt_resume);
static struct platform_driver da9062_wdt_driver = {
.probe = da9062_wdt_probe,
.driver = {
.name = "da9062-watchdog",
- .pm = &da9062_wdt_pm_ops,
+ .pm = pm_ptr(&da9062_wdt_pm_ops),
.of_match_table = da9062_compatible_id_table,
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/8] watchdog: keembay_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-09-14 8:54 ` [PATCH v2 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
2026-09-14 8:54 ` [PATCH v2 2/8] watchdog: da9062: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 9:11 ` sashiko-bot
2026-09-14 9:21 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 4/8] watchdog: msc313e_wdt: " Triet Hoang
` (4 subsequent siblings)
7 siblings, 2 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/keembay_wdt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/keembay_wdt.c b/drivers/watchdog/keembay_wdt.c
index 7c8e53921e40..2c187b20a5ec 100644
--- a/drivers/watchdog/keembay_wdt.c
+++ b/drivers/watchdog/keembay_wdt.c
@@ -250,7 +250,7 @@ static int keembay_wdt_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused keembay_wdt_suspend(struct device *dev)
+static int keembay_wdt_suspend(struct device *dev)
{
struct keembay_wdt *wdt = dev_get_drvdata(dev);
@@ -260,7 +260,7 @@ static int __maybe_unused keembay_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused keembay_wdt_resume(struct device *dev)
+static int keembay_wdt_resume(struct device *dev)
{
struct keembay_wdt *wdt = dev_get_drvdata(dev);
@@ -270,8 +270,7 @@ static int __maybe_unused keembay_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(keembay_wdt_pm_ops, keembay_wdt_suspend,
- keembay_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(keembay_wdt_pm_ops, keembay_wdt_suspend, keembay_wdt_resume);
static const struct of_device_id keembay_wdt_match[] = {
{ .compatible = "intel,keembay-wdt" },
@@ -284,7 +283,7 @@ static struct platform_driver keembay_wdt_driver = {
.driver = {
.name = "keembay_wdt",
.of_match_table = keembay_wdt_match,
- .pm = &keembay_wdt_pm_ops,
+ .pm = pm_sleep_ptr(&keembay_wdt_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 4/8] watchdog: msc313e_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
` (2 preceding siblings ...)
2026-09-14 8:54 ` [PATCH v2 3/8] watchdog: keembay_wdt: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 9:20 ` sashiko-bot
2026-09-14 8:54 ` [PATCH v2 5/8] watchdog: of_xilinx_wdt: " Triet Hoang
` (3 subsequent siblings)
7 siblings, 1 reply; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/msc313e_wdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/msc313e_wdt.c b/drivers/watchdog/msc313e_wdt.c
index 4a5cce2a16b1..a77ff57a4457 100644
--- a/drivers/watchdog/msc313e_wdt.c
+++ b/drivers/watchdog/msc313e_wdt.c
@@ -178,7 +178,7 @@ static int msc313e_wdt_probe(struct platform_device *pdev)
return ret;
}
-static int __maybe_unused msc313e_wdt_suspend(struct device *dev)
+static int msc313e_wdt_suspend(struct device *dev)
{
struct msc313e_wdt_priv *priv = dev_get_drvdata(dev);
@@ -188,7 +188,7 @@ static int __maybe_unused msc313e_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused msc313e_wdt_resume(struct device *dev)
+static int msc313e_wdt_resume(struct device *dev)
{
struct msc313e_wdt_priv *priv = dev_get_drvdata(dev);
@@ -198,13 +198,13 @@ static int __maybe_unused msc313e_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(msc313e_wdt_pm_ops, msc313e_wdt_suspend, msc313e_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(msc313e_wdt_pm_ops, msc313e_wdt_suspend, msc313e_wdt_resume);
static struct platform_driver msc313e_wdt_driver = {
.driver = {
.name = "msc313e-wdt",
.of_match_table = msc313e_wdt_of_match,
- .pm = &msc313e_wdt_pm_ops,
+ .pm = pm_ptr(&msc313e_wdt_pm_ops),
},
.probe = msc313e_wdt_probe,
};
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 5/8] watchdog: of_xilinx_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
` (3 preceding siblings ...)
2026-09-14 8:54 ` [PATCH v2 4/8] watchdog: msc313e_wdt: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 6/8] watchdog: pm8916_wdt: " Triet Hoang
` (2 subsequent siblings)
7 siblings, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/of_xilinx_wdt.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c
index 352853e6fe71..16356d115b30 100644
--- a/drivers/watchdog/of_xilinx_wdt.c
+++ b/drivers/watchdog/of_xilinx_wdt.c
@@ -251,7 +251,7 @@ static int xwdt_probe(struct platform_device *pdev)
* @dev: handle to the device structure.
* Return: 0 always.
*/
-static int __maybe_unused xwdt_suspend(struct device *dev)
+static int xwdt_suspend(struct device *dev)
{
struct xwdt_device *xdev = dev_get_drvdata(dev);
@@ -267,7 +267,7 @@ static int __maybe_unused xwdt_suspend(struct device *dev)
* @dev: handle to the device structure.
* Return: 0 on success, errno otherwise.
*/
-static int __maybe_unused xwdt_resume(struct device *dev)
+static int xwdt_resume(struct device *dev)
{
struct xwdt_device *xdev = dev_get_drvdata(dev);
int ret = 0;
@@ -278,7 +278,7 @@ static int __maybe_unused xwdt_resume(struct device *dev)
return ret;
}
-static SIMPLE_DEV_PM_OPS(xwdt_pm_ops, xwdt_suspend, xwdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(xwdt_pm_ops, xwdt_suspend, xwdt_resume);
/* Match table for of_platform binding */
static const struct of_device_id xwdt_of_match[] = {
@@ -293,7 +293,7 @@ static struct platform_driver xwdt_driver = {
.driver = {
.name = WATCHDOG_NAME,
.of_match_table = xwdt_of_match,
- .pm = &xwdt_pm_ops,
+ .pm = pm_ptr(&xwdt_pm_ops),
},
};
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 6/8] watchdog: pm8916_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
` (4 preceding siblings ...)
2026-09-14 8:54 ` [PATCH v2 5/8] watchdog: of_xilinx_wdt: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 9:33 ` sashiko-bot
2026-09-14 8:54 ` [PATCH v2 7/8] watchdog: sp805_wdt: " Triet Hoang
2026-09-14 8:54 ` [PATCH v2 8/8] watchdog: stmp3xxx_rtc_wdt: " Triet Hoang
7 siblings, 1 reply; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/pm8916_wdt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c
index 007ed139ab96..b97c132de321 100644
--- a/drivers/watchdog/pm8916_wdt.c
+++ b/drivers/watchdog/pm8916_wdt.c
@@ -233,7 +233,7 @@ static int pm8916_wdt_probe(struct platform_device *pdev)
return devm_watchdog_register_device(dev, &wdt->wdev);
}
-static int __maybe_unused pm8916_wdt_suspend(struct device *dev)
+static int pm8916_wdt_suspend(struct device *dev)
{
struct pm8916_wdt *wdt = dev_get_drvdata(dev);
@@ -243,7 +243,7 @@ static int __maybe_unused pm8916_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused pm8916_wdt_resume(struct device *dev)
+static int pm8916_wdt_resume(struct device *dev)
{
struct pm8916_wdt *wdt = dev_get_drvdata(dev);
@@ -253,8 +253,7 @@ static int __maybe_unused pm8916_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(pm8916_wdt_pm_ops, pm8916_wdt_suspend,
- pm8916_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pm8916_wdt_pm_ops, pm8916_wdt_suspend, pm8916_wdt_resume);
static const struct of_device_id pm8916_wdt_id_table[] = {
{ .compatible = "qcom,pm8916-wdt" },
@@ -267,7 +266,7 @@ static struct platform_driver pm8916_wdt_driver = {
.driver = {
.name = "pm8916-wdt",
.of_match_table = pm8916_wdt_id_table,
- .pm = &pm8916_wdt_pm_ops,
+ .pm = pm_ptr(&pm8916_wdt_pm_ops),
},
};
module_platform_driver(pm8916_wdt_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 7/8] watchdog: sp805_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
` (5 preceding siblings ...)
2026-09-14 8:54 ` [PATCH v2 6/8] watchdog: pm8916_wdt: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 8/8] watchdog: stmp3xxx_rtc_wdt: " Triet Hoang
7 siblings, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/sp805_wdt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index c2125f204a13..73f821e2611a 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -321,7 +321,7 @@ static void sp805_wdt_remove(struct amba_device *adev)
watchdog_set_drvdata(&wdt->wdd, NULL);
}
-static int __maybe_unused sp805_wdt_suspend(struct device *dev)
+static int sp805_wdt_suspend(struct device *dev)
{
struct sp805_wdt *wdt = dev_get_drvdata(dev);
@@ -331,7 +331,7 @@ static int __maybe_unused sp805_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused sp805_wdt_resume(struct device *dev)
+static int sp805_wdt_resume(struct device *dev)
{
struct sp805_wdt *wdt = dev_get_drvdata(dev);
@@ -341,8 +341,7 @@ static int __maybe_unused sp805_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend,
- sp805_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(sp805_wdt_dev_pm_ops, sp805_wdt_suspend, sp805_wdt_resume);
static const struct amba_id sp805_wdt_ids[] = {
{
@@ -361,7 +360,7 @@ MODULE_DEVICE_TABLE(amba, sp805_wdt_ids);
static struct amba_driver sp805_wdt_driver = {
.drv = {
.name = MODULE_NAME,
- .pm = &sp805_wdt_dev_pm_ops,
+ .pm = pm_ptr(&sp805_wdt_dev_pm_ops),
},
.id_table = sp805_wdt_ids,
.probe = sp805_wdt_probe,
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 8/8] watchdog: stmp3xxx_rtc_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
` (6 preceding siblings ...)
2026-09-14 8:54 ` [PATCH v2 7/8] watchdog: sp805_wdt: " Triet Hoang
@ 2026-09-14 8:54 ` Triet Hoang
7 siblings, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 8:54 UTC (permalink / raw)
To: linux, tzungbi; +Cc: linux-kernel, linux-watchdog, triet.hoang.dev, wim
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
This lets us drop the __maybe_unused annotations from the resume callback.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/watchdog/stmp3xxx_rtc_wdt.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/watchdog/stmp3xxx_rtc_wdt.c b/drivers/watchdog/stmp3xxx_rtc_wdt.c
index 060447101f48..cdd02661758c 100644
--- a/drivers/watchdog/stmp3xxx_rtc_wdt.c
+++ b/drivers/watchdog/stmp3xxx_rtc_wdt.c
@@ -114,7 +114,7 @@ static void stmp3xxx_wdt_remove(struct platform_device *pdev)
unregister_reboot_notifier(&wdt_notifier);
}
-static int __maybe_unused stmp3xxx_wdt_suspend(struct device *dev)
+static int stmp3xxx_wdt_suspend(struct device *dev)
{
struct watchdog_device *wdd = &stmp3xxx_wdd;
@@ -124,7 +124,7 @@ static int __maybe_unused stmp3xxx_wdt_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused stmp3xxx_wdt_resume(struct device *dev)
+static int stmp3xxx_wdt_resume(struct device *dev)
{
struct watchdog_device *wdd = &stmp3xxx_wdd;
@@ -134,13 +134,12 @@ static int __maybe_unused stmp3xxx_wdt_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(stmp3xxx_wdt_pm_ops,
- stmp3xxx_wdt_suspend, stmp3xxx_wdt_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(stmp3xxx_wdt_pm_ops, stmp3xxx_wdt_suspend, stmp3xxx_wdt_resume);
static struct platform_driver stmp3xxx_wdt_driver = {
.driver = {
.name = "stmp3xxx_rtc_wdt",
- .pm = &stmp3xxx_wdt_pm_ops,
+ .pm = pm_ptr(&stmp3xxx_wdt_pm_ops),
},
.probe = stmp3xxx_wdt_probe,
.remove = stmp3xxx_wdt_remove,
--
2.53.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/8] watchdog: keembay_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 ` [PATCH v2 3/8] watchdog: keembay_wdt: " Triet Hoang
@ 2026-09-14 9:11 ` sashiko-bot
2026-09-14 9:21 ` Triet Hoang
1 sibling, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-09-14 9:11 UTC (permalink / raw)
To: Triet Hoang; +Cc: linux-watchdog
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch uses `pm_sleep_ptr()` for the `dev_pm_ops` structure pointer, which contradicts the commit message and violates PM subsystem guidelines.
--
commit c35ef6ee0f1ec7517f550f44b58852af01504c3c
Author: Triet Hoang <triet.hoang.dev@gmail.com>
watchdog: keembay_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
This commit updates the keembay_wdt driver to use DEFINE_SIMPLE_DEV_PM_OPS(),
allowing the removal of the __maybe_unused annotations on the suspend and
resume callbacks. It also aims to assign the operations using the updated
power management pointer macros.
> diff --git a/drivers/watchdog/keembay_wdt.c b/drivers/watchdog/keembay_wdt.c
> index 7c8e53921e407..2c187b20a5ec1 100644
> --- a/drivers/watchdog/keembay_wdt.c
> +++ b/drivers/watchdog/keembay_wdt.c
[ ... ]
> @@ -284,7 +283,7 @@ static struct platform_driver keembay_wdt_driver = {
> .driver = {
> .name = "keembay_wdt",
> .of_match_table = keembay_wdt_match,
> - .pm = &keembay_wdt_pm_ops,
> + .pm = pm_sleep_ptr(&keembay_wdt_pm_ops),
> },
> };
[Severity: Medium]
The commit message mentions converting to pm_ptr(), but pm_sleep_ptr() is
used here for the dev_pm_ops structure pointer in keembay_wdt_driver.
According to the power management subsystem guidelines, pm_sleep_ptr()
should be used for individual sleep callbacks, while pm_ptr() should be
used for the dev_pm_ops structure pointer itself. Should this be updated
to use pm_ptr() to match both the subsystem guidelines and the stated
intent in the commit message?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914085451.891675-1-triet.hoang.dev@gmail.com?part=3
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/8] watchdog: msc313e_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 ` [PATCH v2 4/8] watchdog: msc313e_wdt: " Triet Hoang
@ 2026-09-14 9:20 ` sashiko-bot
2026-09-16 3:35 ` Tzung-Bi Shih
0 siblings, 1 reply; 16+ messages in thread
From: sashiko-bot @ 2026-09-14 9:20 UTC (permalink / raw)
To: Triet Hoang; +Cc: linux-watchdog
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The msc313e_wdt_resume() callback ignores the return value of msc313e_wdt_start(). If clk_prepare_enable() fails, the clock remains disabled but the watchdog core state still considers it active/running. Subsequent watchdog operations (like ping) will perform blind writes to unclocked hardware registers (e.g., REG_WDT_CLR), leading to a system crash. Additionally, any subsequent stop() call will incorrectly decrement the clock's reference count.
--
commit e0ef26398a011a110179678902a905e77bb75d61
Author: Triet Hoang <triet.hoang.dev@gmail.com>
watchdog: msc313e_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
This commit converts the deprecated SIMPLE_DEV_PM_OPS() macro to
DEFINE_SIMPLE_DEV_PM_OPS() and uses pm_ptr(). It also removes the
__maybe_unused annotations from the suspend and resume callbacks.
> diff --git a/drivers/watchdog/msc313e_wdt.c b/drivers/watchdog/msc313e_wdt.c
> index 4a5cce2a16b18..a77ff57a44571 100644
> --- a/drivers/watchdog/msc313e_wdt.c
> +++ b/drivers/watchdog/msc313e_wdt.c
[ ... ]
> -static int __maybe_unused msc313e_wdt_resume(struct device *dev)
> +static int msc313e_wdt_resume(struct device *dev)
> {
> struct msc313e_wdt_priv *priv = dev_get_drvdata(dev);
>
> if (watchdog_active(&priv->wdev) || watchdog_hw_running(&priv->wdev))
> msc313e_wdt_start(&priv->wdev);
>
> return 0;
[Severity: High]
This is a pre-existing issue, but does msc313e_wdt_resume() need to handle
the return value of msc313e_wdt_start()?
If clk_prepare_enable() fails inside msc313e_wdt_start():
msc313e_wdt_start() {
...
err = clk_prepare_enable(priv->clk);
if (err)
return err;
...
}
The error is returned to msc313e_wdt_resume(), which discards it and returns
0. Because the watchdog core state still considers the hardware active,
could subsequent operations like watchdog ping perform writes to unclocked
hardware registers (such as REG_WDT_CLR) and trigger a bus fault or system
crash?
Additionally, if the clock remains disabled but the watchdog is still tracked
as running, will a subsequent stop() call incorrectly decrement the clock's
enable reference count?
> }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914085451.891675-1-triet.hoang.dev@gmail.com?part=4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/8] watchdog: keembay_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 ` [PATCH v2 3/8] watchdog: keembay_wdt: " Triet Hoang
2026-09-14 9:11 ` sashiko-bot
@ 2026-09-14 9:21 ` Triet Hoang
1 sibling, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-14 9:21 UTC (permalink / raw)
To: triet.hoang.dev; +Cc: linux-kernel, linux-watchdog, linux, tzungbi, wim
On Mon, 14 Sep 2026 15:54:46 +0700 Triet Hoang wrote:
> @@ -284,7 +283,7 @@ static struct platform_driver keembay_wdt_driver = {
> .driver = {
> .name = "keembay_wdt",
> .of_match_table = keembay_wdt_match,
> - .pm = &keembay_wdt_pm_ops,
> + .pm = pm_sleep_ptr(&keembay_wdt_pm_ops),
> },
> };
This shoud be pm_sleep() instead of pm_sleep_ptr() here.
I forgot to change this line. If needed, I can send a v3 to update it.
Thanks, and sorry for the inconvenience.
Regards,
Triet
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 6/8] watchdog: pm8916_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 ` [PATCH v2 6/8] watchdog: pm8916_wdt: " Triet Hoang
@ 2026-09-14 9:33 ` sashiko-bot
0 siblings, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-09-14 9:33 UTC (permalink / raw)
To: Triet Hoang; +Cc: linux-watchdog
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The watchdog will trigger a system hard-reset during suspend if it was started by the bootloader but has not been opened by userspace.
--
commit b8ef3a1624c2c7748578b550a5051929133ba830
Author: Triet Hoang <triet.hoang.dev@gmail.com>
watchdog: pm8916_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
and pm_ptr().
> diff --git a/drivers/watchdog/pm8916_wdt.c b/drivers/watchdog/pm8916_wdt.c
> index 007ed139ab965..b97c132de3216 100644
> --- a/drivers/watchdog/pm8916_wdt.c
> +++ b/drivers/watchdog/pm8916_wdt.c
[ ... ]
> -static int __maybe_unused pm8916_wdt_suspend(struct device *dev)
> +static int pm8916_wdt_suspend(struct device *dev)
> {
> struct pm8916_wdt *wdt = dev_get_drvdata(dev);
[Severity: High]
This isn't a bug introduced by this patch, but I noticed a potential problem
in how pm8916_wdt_suspend() handles the hardware watchdog.
Could this trigger a system hard-reset during sleep?
Looking at the rest of pm8916_wdt_suspend(), it only stops the watchdog
if it is active:
if (watchdog_active(&wdt->wdev))
return pm8916_wdt_stop(&wdt->wdev);
If the bootloader enables the hardware watchdog, the driver's probe function
detects this and sets WDOG_HW_RUNNING. However, if the system suspends before
userspace opens the watchdog device, WDOG_ACTIVE will not be set.
Since watchdog_dev_suspend() pauses its background ping worker thread during
suspend, and pm8916_wdt_suspend() only checks watchdog_active(), the
hardware watchdog is never stopped.
Would it make sense to check both watchdog_active() and watchdog_hw_running()
to ensure we stop the hardware timer before sleep?
[ ... ]
> -static int __maybe_unused pm8916_wdt_resume(struct device *dev)
> +static int pm8916_wdt_resume(struct device *dev)
> {
> struct pm8916_wdt *wdt = dev_get_drvdata(dev);
[Severity: High]
This is also a pre-existing issue, but the resume path also fails to restart
the watchdog if it was previously kept running by the kernel without an
active userspace owner:
if (watchdog_active(&wdt->wdev))
return pm8916_wdt_start(&wdt->wdev);
Would we need to check watchdog_hw_running() here as well?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260914085451.891675-1-triet.hoang.dev@gmail.com?part=6
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/8] watchdog: cadence_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 8:54 ` [PATCH v2 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
@ 2026-09-16 3:28 ` Tzung-Bi Shih
2026-09-16 4:54 ` Triet Hoang
0 siblings, 1 reply; 16+ messages in thread
From: Tzung-Bi Shih @ 2026-09-16 3:28 UTC (permalink / raw)
To: Triet Hoang; +Cc: linux, linux-kernel, linux-watchdog, wim
On Mon, Sep 14, 2026 at 03:54:44PM +0700, Triet Hoang wrote:
> Convert deprecated SIMPLE_DEV_PM_OPS() to DEFINE_SIMPLE_DEV_PM_OPS()
> and pm_ptr().
>
> This lets us drop the __maybe_unused annotations from the resume callback.
^^^^^^^^^^^^^^^
Not only for resume(); maybe just "PM callbacks"? This suggestion applies
to all patches in the series.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/8] watchdog: msc313e_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-14 9:20 ` sashiko-bot
@ 2026-09-16 3:35 ` Tzung-Bi Shih
0 siblings, 0 replies; 16+ messages in thread
From: Tzung-Bi Shih @ 2026-09-16 3:35 UTC (permalink / raw)
To: sashiko-reviews; +Cc: Triet Hoang, linux-watchdog
On Mon, Sep 14, 2026 at 09:20:11AM +0000, sashiko-bot@kernel.org wrote:
> > diff --git a/drivers/watchdog/msc313e_wdt.c b/drivers/watchdog/msc313e_wdt.c
> > index 4a5cce2a16b18..a77ff57a44571 100644
> > --- a/drivers/watchdog/msc313e_wdt.c
> > +++ b/drivers/watchdog/msc313e_wdt.c
>
> [ ... ]
>
> > -static int __maybe_unused msc313e_wdt_resume(struct device *dev)
> > +static int msc313e_wdt_resume(struct device *dev)
> > {
> > struct msc313e_wdt_priv *priv = dev_get_drvdata(dev);
> >
> > if (watchdog_active(&priv->wdev) || watchdog_hw_running(&priv->wdev))
> > msc313e_wdt_start(&priv->wdev);
> >
> > return 0;
>
> [Severity: High]
> This is a pre-existing issue, but does msc313e_wdt_resume() need to handle
> the return value of msc313e_wdt_start()?
>
> If clk_prepare_enable() fails inside msc313e_wdt_start():
>
> msc313e_wdt_start() {
> ...
> err = clk_prepare_enable(priv->clk);
> if (err)
> return err;
> ...
> }
>
> The error is returned to msc313e_wdt_resume(), which discards it and returns
> 0. Because the watchdog core state still considers the hardware active,
> could subsequent operations like watchdog ping perform writes to unclocked
> hardware registers (such as REG_WDT_CLR) and trigger a bus fault or system
> crash?
https://lore.kernel.org/all/20260912163334.28636-1-tzungbi@kernel.org tries
to address the issue.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 1/8] watchdog: cadence_wdt: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-09-16 3:28 ` Tzung-Bi Shih
@ 2026-09-16 4:54 ` Triet Hoang
0 siblings, 0 replies; 16+ messages in thread
From: Triet Hoang @ 2026-09-16 4:54 UTC (permalink / raw)
To: tzungbi; +Cc: linux-kernel, linux-watchdog, linux, triet.hoang.dev, wim
On Wed, 16 Sep 2026 03:28:04 +0000 Tzung-Bi Shih wrote:
> Not only for resume(); maybe just "PM callbacks"? This suggestion applies
> to all patches in the series.
You're right! I will update this in v3.
Thanks for review,
Triet
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-09-16 4:54 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 8:54 [PATCH v2 0/8] watchdog: Convert drivers to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-09-14 8:54 ` [PATCH v2 1/8] watchdog: cadence_wdt: Convert " Triet Hoang
2026-09-16 3:28 ` Tzung-Bi Shih
2026-09-16 4:54 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 2/8] watchdog: da9062: " Triet Hoang
2026-09-14 8:54 ` [PATCH v2 3/8] watchdog: keembay_wdt: " Triet Hoang
2026-09-14 9:11 ` sashiko-bot
2026-09-14 9:21 ` Triet Hoang
2026-09-14 8:54 ` [PATCH v2 4/8] watchdog: msc313e_wdt: " Triet Hoang
2026-09-14 9:20 ` sashiko-bot
2026-09-16 3:35 ` Tzung-Bi Shih
2026-09-14 8:54 ` [PATCH v2 5/8] watchdog: of_xilinx_wdt: " Triet Hoang
2026-09-14 8:54 ` [PATCH v2 6/8] watchdog: pm8916_wdt: " Triet Hoang
2026-09-14 9:33 ` sashiko-bot
2026-09-14 8:54 ` [PATCH v2 7/8] watchdog: sp805_wdt: " Triet Hoang
2026-09-14 8:54 ` [PATCH v2 8/8] watchdog: stmp3xxx_rtc_wdt: " Triet Hoang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox