All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: robh@kernel.org, alsa-devel@alsa-project.org,
	linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
	b.zolnierkie@samsung.com, linux-kernel@vger.kernel.org,
	inki.dae@samsung.com, broonie@kernel.org,
	Beomho Seo <beomho.seo@samsung.com>,
	ideal.song@samsung.com
Subject: Re: [PATCH v4 2/4] mfd: Add Samsung Exynos Low Power Audio Subsystem driver
Date: Wed, 10 Aug 2016 12:19:18 +0100	[thread overview]
Message-ID: <20160810111918.GS1581@dell> (raw)
In-Reply-To: <a66ab86f-d5da-0462-81c9-48469721d229@samsung.com>

On Wed, 10 Aug 2016, Sylwester Nawrocki wrote:

> On 08/09/2016 10:50 PM, Lee Jones wrote:
> > On Tue, 09 Aug 2016, Sylwester Nawrocki wrote:
> > 
> >> > On 08/09/2016 05:05 PM, Lee Jones wrote:
> >>>> > >> +static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend,
> >>>>> > >> > +					exynos_lpass_resume);
> >>> > > Put this up by the PM functions.
> >> > 
> >> > Sorry, I don't understand this comment, which PM functions do you
> >> > mean exactly?
> > *_suspend and *_resume.  PM == Power Management.
> > 
> > You also need to place the functions in side some CONFIG_PM_SLEEP
> > guards.  Grep around, you'll see what I mean.
> 
> OK, but couldn't we just leave it with that SIMPLE_DEV_PM_OPS()
> macro?  It saves us an #ifdef ugliness and if I actually grep
> drivers/mfd most of the drivers use either SIMPLE_DEV_PM_OPS() or
> SET_SYSTEM_SLEEP_PM_OPS. Are you asking me to change the above to:
> 
> static const struct dev_pm_ops exynos_lpass_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> 	.suspend = exynos_lpass_suspend,
> 	.resume = exynos_lpass_resume,
> 	.freeze = exynos_lpass_suspend,
> 	.thaw = exynos_lpass_resume,
> 	.poweroff = exynos_lpass_suspend,
> 	.restore = exynos_lpass_resume,
> #endif
> }
> 
> or perhaps
> 
> static const struct dev_pm_ops exynos_lpass_pm_ops = {
> 	SET_SYSTEM_SLEEP_PM_OPS(exynos_lpass_suspend, exynos_lpass_resume)
> }
> 
> ?

Not like that.  Grep 'drivers/mfd' for "CONFIG_PM_SLEEP" as
suggested.  You will find that the actual *_suspend and *_resume
functions are guarded in order to save space.

> I agree about the CONFIG_PM_SLEEP guards.  There is very little
> chance though the LPASS driver will ever be used with
> CONFIG_PM_SLEEP disabled. How about adding __maybe_unused attribute
> to the *_suspend/*_resume functions then?  I can see this pattern
> used already in drivers/mfd.

It's more common practice to use CONFIG_PM_SLEEP:

$ git grep __maybe_unused -- drivers/mfd/ | wc -l
7
$ git grep CONFIG_PM_SLEEP -- drivers/mfd/ | wc -l
31

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

WARNING: multiple messages have this Message-ID (diff)
From: Lee Jones <lee.jones@linaro.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: broonie@kernel.org, robh@kernel.org, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, ideal.song@samsung.com,
	inki.dae@samsung.com, b.zolnierkie@samsung.com,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Beomho Seo <beomho.seo@samsung.com>
Subject: Re: [PATCH v4 2/4] mfd: Add Samsung Exynos Low Power Audio Subsystem driver
Date: Wed, 10 Aug 2016 12:19:18 +0100	[thread overview]
Message-ID: <20160810111918.GS1581@dell> (raw)
In-Reply-To: <a66ab86f-d5da-0462-81c9-48469721d229@samsung.com>

On Wed, 10 Aug 2016, Sylwester Nawrocki wrote:

> On 08/09/2016 10:50 PM, Lee Jones wrote:
> > On Tue, 09 Aug 2016, Sylwester Nawrocki wrote:
> > 
> >> > On 08/09/2016 05:05 PM, Lee Jones wrote:
> >>>> > >> +static SIMPLE_DEV_PM_OPS(lpass_pm_ops, exynos_lpass_suspend,
> >>>>> > >> > +					exynos_lpass_resume);
> >>> > > Put this up by the PM functions.
> >> > 
> >> > Sorry, I don't understand this comment, which PM functions do you
> >> > mean exactly?
> > *_suspend and *_resume.  PM == Power Management.
> > 
> > You also need to place the functions in side some CONFIG_PM_SLEEP
> > guards.  Grep around, you'll see what I mean.
> 
> OK, but couldn't we just leave it with that SIMPLE_DEV_PM_OPS()
> macro?  It saves us an #ifdef ugliness and if I actually grep
> drivers/mfd most of the drivers use either SIMPLE_DEV_PM_OPS() or
> SET_SYSTEM_SLEEP_PM_OPS. Are you asking me to change the above to:
> 
> static const struct dev_pm_ops exynos_lpass_pm_ops = {
> #ifdef CONFIG_PM_SLEEP
> 	.suspend = exynos_lpass_suspend,
> 	.resume = exynos_lpass_resume,
> 	.freeze = exynos_lpass_suspend,
> 	.thaw = exynos_lpass_resume,
> 	.poweroff = exynos_lpass_suspend,
> 	.restore = exynos_lpass_resume,
> #endif
> }
> 
> or perhaps
> 
> static const struct dev_pm_ops exynos_lpass_pm_ops = {
> 	SET_SYSTEM_SLEEP_PM_OPS(exynos_lpass_suspend, exynos_lpass_resume)
> }
> 
> ?

Not like that.  Grep 'drivers/mfd' for "CONFIG_PM_SLEEP" as
suggested.  You will find that the actual *_suspend and *_resume
functions are guarded in order to save space.

> I agree about the CONFIG_PM_SLEEP guards.  There is very little
> chance though the LPASS driver will ever be used with
> CONFIG_PM_SLEEP disabled. How about adding __maybe_unused attribute
> to the *_suspend/*_resume functions then?  I can see this pattern
> used already in drivers/mfd.

It's more common practice to use CONFIG_PM_SLEEP:

$ git grep __maybe_unused -- drivers/mfd/ | wc -l
7
$ git grep CONFIG_PM_SLEEP -- drivers/mfd/ | wc -l
31

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

  reply	other threads:[~2016-08-10 11:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-05 17:13 [PATCH v4 2/4] mfd: Add Samsung Exynos Low Power Audio Subsystem driver Sylwester Nawrocki
2016-07-20 15:11 ` Sylwester Nawrocki
2016-07-21 12:11   ` Lee Jones
     [not found] ` <1467738804-31460-1-git-send-email-s.nawrocki-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-09 15:05   ` Lee Jones
2016-08-09 15:05     ` Lee Jones
2016-08-09 15:36     ` Sylwester Nawrocki
2016-08-09 15:36       ` Sylwester Nawrocki
     [not found]       ` <61d700f7-ef66-8278-54ea-8e6e2f1a029e-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-09 20:50         ` Lee Jones
2016-08-09 20:50           ` Lee Jones
2016-08-10  8:36           ` Sylwester Nawrocki
2016-08-10  8:36             ` Sylwester Nawrocki
2016-08-10 11:19             ` Lee Jones [this message]
2016-08-10 11:19               ` Lee Jones

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=20160810111918.GS1581@dell \
    --to=lee.jones@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=beomho.seo@samsung.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ideal.song@samsung.com \
    --cc=inki.dae@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.nawrocki@samsung.com \
    /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 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.