From: Guenter Roeck <linux@roeck-us.net>
To: Jerry Hoemann <jerry.hoemann@hpe.com>
Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/1] watchdog/hpwdt: Support Suspend and Resume
Date: Wed, 14 Feb 2024 08:55:52 -0800 [thread overview]
Message-ID: <a4313c63-73e0-4a38-8d9b-5c5eccf0b5e0@roeck-us.net> (raw)
In-Reply-To: <20240214164941.630775-2-jerry.hoemann@hpe.com>
On 2/14/24 08:49, Jerry Hoemann wrote:
> Add call backs to support suspend and resume.
>
> Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/hpwdt.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
> index 138dc8d8ca3d..ae30e394d176 100644
> --- a/drivers/watchdog/hpwdt.c
> +++ b/drivers/watchdog/hpwdt.c
> @@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
> pci_disable_device(dev);
> }
>
> +static int hpwdt_suspend(struct device *dev)
> +{
> + if (watchdog_active(&hpwdt_dev))
> + hpwdt_stop();
> +
> + return 0;
> +}
> +
> +static int hpwdt_resume(struct device *dev)
> +{
> + if (watchdog_active(&hpwdt_dev))
> + hpwdt_start(&hpwdt_dev);
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops hpwdt_pm_ops = {
> + LATE_SYSTEM_SLEEP_PM_OPS(hpwdt_suspend, hpwdt_resume)
> +};
> +
> static struct pci_driver hpwdt_driver = {
> .name = "hpwdt",
> .id_table = hpwdt_devices,
> .probe = hpwdt_init_one,
> .remove = hpwdt_exit,
> +
> + .driver = {
> + .name = "hpwdt",
> + .pm = &hpwdt_pm_ops,
> + }
> };
>
> MODULE_AUTHOR("Tom Mingarelli");
prev parent reply other threads:[~2024-02-14 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 16:49 [PATCH v2 0/1] " Jerry Hoemann
2024-02-14 16:49 ` [PATCH v2 1/1] " Jerry Hoemann
2024-02-14 16:55 ` Guenter Roeck [this message]
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=a4313c63-73e0-4a38-8d9b-5c5eccf0b5e0@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jerry.hoemann@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@linux-watchdog.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®