Re: [PATCH 4.4.y-cip 18/23] PM / OPP: Initialize regulator pointer to an error value

Pavel Machek

On Wed 2020-07-08 23:45:49, Chen-Yu Tsai (Moxa) wrote:
From: Viresh Kumar <viresh.kumar@...>

commit 0c717d0f9cb46259dce5272705adce64a2d646d9 upstream.

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.
Again, this should be close to (or merged with) patch 2/ of the series.

Best regards,

DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Join to automatically receive all group messages.