All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Lina Iyer <lina.iyer@linaro.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] PM / Domains: Replace -ENOSYS with -ENODEV
Date: Sat, 6 Aug 2016 01:44:25 +0200	[thread overview]
Message-ID: <20160805234425.GA5079@wunner.de> (raw)
In-Reply-To: <CAJZ5v0hXNDRCztvDDii+qKEDz26W16e=eq9yDB+59G-AVrKhMw@mail.gmail.com>

On Sat, Aug 06, 2016 at 12:17:58AM +0200, Rafael J. Wysocki wrote:
> On Fri, Aug 5, 2016 at 9:43 PM, Lukas Wunner <lukas@wunner.de> wrote:
> > On Fri, Aug 05, 2016 at 11:06:56AM -0600, Lina Iyer wrote:
> >> ENOSYS is for syscalls that are not supported. ENODEV is a better return
> >> value when the PM Domains are not available.
> >>
> >> Signed-off-by: Lina Iyer <lina.iyer@linaro.org>
> >
> > I have no opinion on this, but would like to point out that other parts
> > in the PM core use -ENOSYS as well (e.g. see drivers/base/power/core.c).

I meant drivers/base/power/runtime.c and include/linux/pm_runtime.h,
apologies.

> > For consistency, if pm_domain.h is changed, the rest should probably be
> > changed as well.
> 
> I agree here.  Changing one piece only is likely to result in confusion.
> 
> Also I'm not sure if ENODEV is a good replacement at all.  ENOTSUPP
> was suggested instead last time a similar patch was discussed.
> 
> > It should also be kept in mind that functions might
> > check the return code and react specifically to the currently used -ENOSYS.
> > (I've written code like that just yesterday, for the (unmerged) thunderbolt
> > runtime pm.)
> 
> But I wouldn't write code doing something like this.

Understood, I just removed it from my tree. :-)

Thanks,

Lukas

  reply	other threads:[~2016-08-06 20:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-05 17:06 [PATCH] PM / Domains: Replace -ENOSYS with -ENODEV Lina Iyer
2016-08-05 19:43 ` Lukas Wunner
2016-08-05 22:17   ` Rafael J. Wysocki
2016-08-05 23:44     ` Lukas Wunner [this message]
2016-08-08  9:11     ` Geert Uytterhoeven
2016-08-08 13:04       ` Rafael J. Wysocki

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=20160805234425.GA5079@wunner.de \
    --to=lukas@wunner.de \
    --cc=lina.iyer@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=ulf.hansson@linaro.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 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.