From: Guenter Roeck <linux@roeck-us.net>
To: W_Armin@gmx.de
Cc: jdelvare@suse.com, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v2] hwmon: (w83627ehf) Switch to SIMPLE_DEV_PM_OPS
Date: Thu, 22 Jul 2021 08:56:21 -0700 [thread overview]
Message-ID: <20210722155621.GA3369842@roeck-us.net> (raw)
In-Reply-To: <20210721192519.28784-1-W_Armin@gmx.de>
On Wed, Jul 21, 2021 at 09:25:19PM +0200, W_Armin@gmx.de wrote:
> From: Armin Wolf <W_Armin@gmx.de>
>
> Use SIMPLE_DEV_PM_OPS() to also assign poweroff
> and thaw callbacks. Remove the now obsolete checking
> of CONFIG_PM too.
>
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> changes in v2:
> - remove last check of CONFIG_PM
> ---
> drivers/hwmon/w83627ehf.c | 21 ++++-----------------
> 1 file changed, 4 insertions(+), 17 deletions(-)
>
> --
> 2.20.1
>
> diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
> index 19af84574324..3cea66c58c25 100644
> --- a/drivers/hwmon/w83627ehf.c
> +++ b/drivers/hwmon/w83627ehf.c
> @@ -372,12 +372,10 @@ struct w83627ehf_data {
> u8 temp3_val_only:1;
> u8 have_vid:1;
>
> -#ifdef CONFIG_PM
> /* Remember extra register values over suspend/resume */
> u8 vbat;
> u8 fandiv1;
> u8 fandiv2;
> -#endif
> };
>
> struct w83627ehf_sio_data {
> @@ -1946,8 +1944,7 @@ static int __init w83627ehf_probe(struct platform_device *pdev)
> return PTR_ERR_OR_ZERO(hwmon_dev);
> }
>
> -#ifdef CONFIG_PM
> -static int w83627ehf_suspend(struct device *dev)
> +static int __maybe_unused w83627ehf_suspend(struct device *dev)
> {
> struct w83627ehf_data *data = w83627ehf_update_device(dev);
>
> @@ -1958,7 +1955,7 @@ static int w83627ehf_suspend(struct device *dev)
> return 0;
> }
>
> -static int w83627ehf_resume(struct device *dev)
> +static int __maybe_unused w83627ehf_resume(struct device *dev)
> {
> struct w83627ehf_data *data = dev_get_drvdata(dev);
> int i;
> @@ -2013,22 +2010,12 @@ static int w83627ehf_resume(struct device *dev)
> return 0;
> }
>
> -static const struct dev_pm_ops w83627ehf_dev_pm_ops = {
> - .suspend = w83627ehf_suspend,
> - .resume = w83627ehf_resume,
> - .freeze = w83627ehf_suspend,
> - .restore = w83627ehf_resume,
> -};
> -
> -#define W83627EHF_DEV_PM_OPS (&w83627ehf_dev_pm_ops)
> -#else
> -#define W83627EHF_DEV_PM_OPS NULL
> -#endif /* CONFIG_PM */
> +static SIMPLE_DEV_PM_OPS(w83627ehf_dev_pm_ops, w83627ehf_suspend, w83627ehf_resume);
>
> static struct platform_driver w83627ehf_driver = {
> .driver = {
> .name = DRVNAME,
> - .pm = W83627EHF_DEV_PM_OPS,
> + .pm = &w83627ehf_dev_pm_ops,
> },
> };
prev parent reply other threads:[~2021-07-22 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-21 19:25 [PATCH v2] hwmon: (w83627ehf) Switch to SIMPLE_DEV_PM_OPS W_Armin
2021-07-22 15:56 ` 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=20210722155621.GA3369842@roeck-us.net \
--to=linux@roeck-us.net \
--cc=W_Armin@gmx.de \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.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