[<prev] [next>] [day] [month] [year] [list]
Message-id: <25178027.160161350527407382.JavaMail.weblogic@epml06>
Date: Thu, 18 Oct 2012 02:30:09 +0000 (GMT)
From: MyungJoo Ham <myungjoo.ham@...sung.com>
To: Nishanth Menon <nm@...com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
Cc: ¹Ú°æ¹Î <kyungmin.park@...sung.com>,
"Rafael J. Wysocki" <rjw@...k.pl>, Kevin Hilman <khilman@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] PM / OPP: predictable fail results for opp_find* functions
> Currently the opp_find* functions return -ENODEV when:
> a) it cant find a device (e.g. request for an OPP search on device
> which was not registered)
> b) When it cant find a match for the search strategy used
>
> This makes life a little in-efficient for users such as devfreq
> to make reasonable judgement before switching search strategies.
>
> So, standardize the return results as following:
> -EINVAL for bad pointer parameters
> -ENODEV when device cannot be found
> -ERANGE when search fails
>
> This has the following benefit for devfreq implementation:
>
> Current code:
> opp = opp_find_freq_floor(dev, freq);
> /* Following search triggers even for un-registered device */
> if (opp == ERR_PTR(-ENODEV))
> opp = opp_find_freq_ceil(dev, freq);
>
> Vs (after this change):
> opp = opp_find_freq_floor(dev, freq);
> /* Will only be triggered if search logic fails: intended usage */
> if (opp == ERR_PTR(-ERANGE))
> opp = opp_find_freq_ceil(dev, freq);
>
> Cc: MyungJoo Ham <myungjoo.ham@...sung.com>
> Cc: Kyungmin Park <kyungmin.park@...sung.com>
> Cc: "Rafael J. Wysocki" <rjw@...k.pl>
> Cc: Kevin Hilman <khilman@...com>
> Cc: linux-pm@...r.kernel.org
> Cc: linux-kernel@...r.kernel.org
>
> Signed-off-by: Nishanth Menon <nm@...com>
Thanks.
Acked-by: MyungJoo Ham <myungjoo.ham@...sung.com>
>
Powered by blists - more mailing lists