* [PATCH] media: bttv: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-21 6:27 Triet Hoang
0 siblings, 0 replies; only message in thread
From: Triet Hoang @ 2026-08-21 6:27 UTC (permalink / raw)
To: mchehab; +Cc: linux-media, linux-kernel, Triet Hoang
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS
and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations
from its suspend and resume callbacks,
also reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/media/pci/bt8xx/bttv-driver.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index c631b8bbd386..8b9ca59f9434 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -3504,7 +3504,7 @@ static void bttv_remove(struct pci_dev *pci_dev)
return;
}
-static int __maybe_unused bttv_suspend(struct device *dev)
+static int bttv_suspend(struct device *dev)
{
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
struct bttv *btv = to_bttv(v4l2_dev);
@@ -3535,7 +3535,7 @@ static int __maybe_unused bttv_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused bttv_resume(struct device *dev)
+static int bttv_resume(struct device *dev)
{
struct v4l2_device *v4l2_dev = dev_get_drvdata(dev);
struct bttv *btv = to_bttv(v4l2_dev);
@@ -3573,7 +3573,7 @@ static const struct pci_device_id bttv_pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, bttv_pci_tbl);
-static SIMPLE_DEV_PM_OPS(bttv_pm_ops,
+static DEFINE_SIMPLE_DEV_PM_OPS(bttv_pm_ops,
bttv_suspend,
bttv_resume);
@@ -3582,7 +3582,7 @@ static struct pci_driver bttv_pci_driver = {
.id_table = bttv_pci_tbl,
.probe = bttv_probe,
.remove = bttv_remove,
- .driver.pm = &bttv_pm_ops,
+ .driver.pm = pm_sleep_ptr(&bttv_pm_ops),
};
static int __init bttv_init_module(void)
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-21 6:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 6:27 [PATCH] media: bttv: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
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.