Skip to content
Commit 0c717d0f authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki
Browse files

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: 7d34d56e

 (PM / OPP: Disable OPPs that aren't supported by the regulator)
Reported-and-tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Reported-and-tested-by: default avatarTony Lindgren <tony@atomide.com>
Reported-and-tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
[ rjw: Initialize to -ENXIO ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c88c395f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment