]> 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)
commit7e88ed669b6c1a91578a5faa525d1e5ea086a5e9
treee2b8424dd7931c98f730720e7062251bdf6b84fd
parent953032be3a4de0d3387975e38852cf3ca7f2f397
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: e660e25567a5 (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