From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukas Wunner Subject: Re: [PATCH] PM / Domains: Replace -ENOSYS with -ENODEV Date: Sat, 6 Aug 2016 01:44:25 +0200 Message-ID: <20160805234425.GA5079@wunner.de> References: <1470416816-53336-1-git-send-email-lina.iyer@linaro.org> <20160805194329.GA5020@wunner.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailout3.hostsharing.net ([176.9.242.54]:58493 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbcHFUTB (ORCPT ); Sat, 6 Aug 2016 16:19:01 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Rafael J. Wysocki" Cc: Lina Iyer , Ulf Hansson , "Rafael J. Wysocki" , Linux PM 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 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 > > > > 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