]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: Initialize regulator pointer to an error value
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 15 Feb 2016 16:26:42 +0000 (21:56 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 16 Feb 2016 12:12:41 +0000 (13:12 +0100)
commit134312ea2145545f845532724318912bc9c5743f
treee2b8424dd7931c98f730720e7062251bdf6b84fd
parent9040ce18b23f7e384931f09bee627c76c6a984f7
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: adadd9bf62ad (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>
drivers/base/power/opp/core.c