Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>, linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: jc42: Simplify pm ops handling
Date: Tue, 14 Nov 2023 15:16:13 +0100	[thread overview]
Message-ID: <0a156edb-8955-4775-accf-ff5abe32a8fe@gmail.com> (raw)
In-Reply-To: <a9b99531-cd00-4d4c-b046-cdd2e8ef202d@roeck-us.net>

On 14.11.2023 14:53, Guenter Roeck wrote:
> On Mon, Nov 13, 2023 at 08:20:49PM +0100, Heiner Kallweit wrote:
>> Use pm_sleep_ptr/DEFINE_SIMPLE_DEV_PM_OPS to simplify the code.
>>
>> Note: Apparently conditional compiling based on CONFIG_PM
>> wasn't optimal, it should have been CONFIG_PM_SLEEP.
> 
> Maybe that is apparent to you, but not to me, and I assume it won't
> be apparent to others either. That warrants a real explanation,
> not just "apparently".
> 

See e.g. pm_generic_suspend(), it's NULL if CONFIG_PM_SLEEP isn't
defined. Another hint is the following from pm.h:

#ifdef CONFIG_PM_SLEEP
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
	SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#else
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#endif

CONFIG_PM_SLEEP implies CONFIG_PM, but we can have a setup where
CONFIG_PM is defined but CONFIG_PM_SLEEP is not. In this case
jc42_suspend/resume would be defined but not used by the PM core.

> Guenter

Heiner

      reply	other threads:[~2023-11-14 14:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-13 19:20 [PATCH] hwmon: jc42: Simplify pm ops handling Heiner Kallweit
2023-11-14 13:53 ` Guenter Roeck
2023-11-14 14:16   ` Heiner Kallweit [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=0a156edb-8955-4775-accf-ff5abe32a8fe@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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