mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Randy Dunlap <rdunlap@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Wei WANG <wei_wang@realsil.com.cn>,
	Kai-Heng Feng <kai.heng.feng@canonical.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH -next] misc: rtsx: fix build for CONFIG_PM not set
Date: Sun, 27 Feb 2022 17:46:12 +0000	[thread overview]
Message-ID: <0D5Z7R.NUOWBMRT4GQ2@crapouillou.net> (raw)
In-Reply-To: <CAK8P3a30RbSk3Y5CyRrOjfTiq0c9XGxC3qjAD0154j3a7k+xQQ@mail.gmail.com>

Hi,

Le dim., févr. 27 2022 at 18:30:16 +0100, Arnd Bergmann 
<arnd@arndb.de> a écrit :
> On Sun, Feb 27, 2022 at 5:57 PM Randy Dunlap <rdunlap@infradead.org> 
> wrote:
>>  On 2/27/22 04:04, Arnd Bergmann wrote:
>>  > On Sat, Feb 26, 2022 at 11:24 PM Randy Dunlap 
>> <rdunlap@infradead.org> wrote:
>>  >
>>  >> ---
>>  >>  drivers/misc/cardreader/rtsx_pcr.c |    2 ++
>>  >>  1 file changed, 2 insertions(+)
>>  >>
>>  >> --- linux-next-20220225.orig/drivers/misc/cardreader/rtsx_pcr.c
>>  >> +++ linux-next-20220225/drivers/misc/cardreader/rtsx_pcr.c
>>  >> @@ -1054,6 +1054,7 @@ static int rtsx_pci_acquire_irq(struct r
>>  >>         return 0;
>>  >>  }
>>  >>
>>  >> +#ifdef CONFIG_PM
>>  >>  static void rtsx_enable_aspm(struct rtsx_pcr *pcr)
>>  >>  {
>>  >>         if (pcr->ops->set_aspm)
>>  >> @@ -1085,6 +1086,7 @@ static void rtsx_pm_power_saving(struct
>>  >>  {
>>  >>         rtsx_comm_pm_power_saving(pcr);
>>  >>  }
>>  >> +#endif
>>  >
>>  > Now that we have DEFINE_SIMPLE_DEV_PM_OPS() etc, I think we should
>>  > no longer add more __maybe_unused annotations or #ifdef CONFIG_PM 
>> checks
>>  > but just use the new macros for any new files or whenever a 
>> warning like
>>  > this shows up.
>> 
>>  In this case it looks like DEFINE_RUNTIME_DEV_PM_OPS() is better.
>>  Using DEFINE_SIMPLE_DEV_PM_OPS() still produces build 
>> warnings/errors
>>  for unused functions. And I do see 4 drivers that are already using
>>  DEFINE_RUNTIME_DEV_PM_OPS().
>> 
>>  Patch coming right up.
> 
> DEFINE_RUNTIME_DEV_PM_OPS() only references the three runtime 
> functions
> (rtsx_pci_runtime_suspend, rtsx_pci_runtime_resume and 
> rtsx_pci_runtime_idle)
> but not the pm-sleep functions (rtsx_pci_suspend and 
> rtsx_pci_resume), so your
> second patch doesn't look correct either.
> 
> I see there is a _DEFINE_DEV_PM_OPS() helper that appears to do
> what we want here, but I'm not sure this is considered an official 
> API. Adding
> Rafael, Paul and Jonathan to Cc for extra input. As the macros are 
> still
> fairly new, I suspect the idea was to add more as needed, so maybe 
> should
> add a DEFINE_DEV_PM_OPS() to wrap _DEFINE_DEV_PM_OPS()?


There could be a DEFINE_DEV_PM_OPS(), but I don't think that's really 
needed - you can very well declare your struct dev_pm_ops without using 
one of these macros. Just make sure to use the SYSTEM_SLEEP_PM_OPS / 
RUNTIME_PM_OPS macros for the callbacks and pm_ptr() for the device.pm 
pointer.

Cheers,
-Paul



  reply	other threads:[~2022-02-27 17:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 22:24 Randy Dunlap
2022-02-27 12:04 ` Arnd Bergmann
2022-02-27 16:57   ` Randy Dunlap
2022-02-27 17:30     ` Arnd Bergmann
2022-02-27 17:46       ` Paul Cercueil [this message]
2022-02-27 17:51         ` Arnd Bergmann
2022-02-27 17:56           ` Paul Cercueil
2022-03-06 15:12             ` Jonathan Cameron
2022-03-06 15:29               ` Paul Cercueil
2022-03-06 17:57                 ` Jonathan Cameron
2022-03-06 16:24               ` Jonathan Cameron

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=0D5Z7R.NUOWBMRT4GQ2@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kai.heng.feng@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=wei_wang@realsil.com.cn \
    /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®