linux/drivers/base/power/opp
Viresh Kumar 0c717d0f9c PM / OPP: Initialize regulator pointer to an error value
We are currently required to do two checks for regulator pointer:
IS_ERR() and IS_NULL().

And multiple instances are reported, about both of these not being used
consistently and so resulting in crashes.

Fix that by initializing regulator pointer with an error value and
checking it only against an error.

This makes code more consistent and more efficient.

Fixes: 7d34d56ef3 (PM / OPP: Disable OPPs that aren't supported by the regulator)
Reported-and-tested-by: Jon Hunter <jonathanh@nvidia.com>
Reported-and-tested-by: Tony Lindgren <tony@atomide.com>
Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
[ rjw: Initialize to -ENXIO ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-02-16 13:12:41 +01:00
..
core.c PM / OPP: Initialize regulator pointer to an error value 2016-02-16 13:12:41 +01:00
cpu.c PM / OPP: Set cpu_dev->id in cpumask first 2016-01-02 00:48:11 +01:00
debugfs.c PM / OPP: Add debugfs support 2015-11-23 23:38:23 +01:00
Makefile PM / OPP: Add debugfs support 2015-11-23 23:38:23 +01:00
opp.h PM / OPP: Manage device clk 2016-02-10 01:11:54 +01:00