kernel-hacking-2024-linux-s.../drivers/base/power
Nishanth Menon 0779726cc2 PM / OPP: predictable fail results for opp_find* functions, v2
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:
The search fails when an unregistered device pointer is provided.
This is a trigger to change the search direction and search for
a better fit, however, if we cannot differentiate between a valid
search range failure Vs an unregistered device, second search goes
through the same fail return condition. This can be avoided by
appropriate handling of error return code.

With this change, we also fix devfreq for the improved search
strategy with updated error code.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2012-11-15 00:36:10 +01:00
..
clock_ops.c PM: Make dev_pm_get_subsys_data() always return 0 on success 2012-08-08 20:49:33 +02:00
common.c PM: Do not use the syscore flag for runtime PM 2012-09-04 01:36:05 +02:00
domain.c PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle 2012-10-23 00:54:38 +02:00
domain_governor.c PM / Domains: Fix computation of maximum domain off time 2012-05-11 21:11:44 +02:00
generic_ops.c PM / Sleep: Introduce generic callbacks for new device PM phases 2012-01-29 20:38:41 +01:00
main.c Power management updates for 3.7-rc1 2012-10-02 18:32:35 -07:00
Makefile PM / Domains: Add device stop governor function (v4) 2011-12-01 21:47:40 +01:00
opp.c PM / OPP: predictable fail results for opp_find* functions, v2 2012-11-15 00:36:10 +01:00
power.h PM / Runtime: Allow helpers to be called by early platform drivers 2012-09-04 01:36:03 +02:00
qos.c Revert "PM QoS: Use spinlock in the per-device PM QoS constraints code" 2012-09-24 21:39:36 +02:00
runtime.c PM / Runtime: let rpm_resume() succeed if RPM_ACTIVE, even when disabled, v2 2012-09-22 21:15:08 +02:00
sysfs.c PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset 2012-07-12 22:40:02 +02:00
trace.c drivers/base: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required. 2011-10-31 19:31:38 -04:00
wakeup.c PM / wakeup: Use irqsave/irqrestore for events_lock 2012-09-06 23:19:06 +02:00