Commit da978b6
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: 7d34d56ef334 (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>
(cherry picked from commit 0c717d0f9cb46259dce5272705adce64a2d646d9)
Signed-off-by: Alex Shi <alex.shi@linaro.org>1 parent 0ff7577 commit da978b6
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
801 | 804 | | |
802 | 805 | | |
803 | 806 | | |
| |||
845 | 848 | | |
846 | 849 | | |
847 | 850 | | |
848 | | - | |
| 851 | + | |
849 | 852 | | |
850 | 853 | | |
851 | 854 | | |
| |||
975 | 978 | | |
976 | 979 | | |
977 | 980 | | |
978 | | - | |
| 981 | + | |
979 | 982 | | |
980 | 983 | | |
981 | 984 | | |
| |||
1441 | 1444 | | |
1442 | 1445 | | |
1443 | 1446 | | |
1444 | | - | |
| 1447 | + | |
1445 | 1448 | | |
1446 | 1449 | | |
1447 | 1450 | | |
| |||
1492 | 1495 | | |
1493 | 1496 | | |
1494 | 1497 | | |
1495 | | - | |
| 1498 | + | |
1496 | 1499 | | |
1497 | 1500 | | |
1498 | 1501 | | |
| |||
1501 | 1504 | | |
1502 | 1505 | | |
1503 | 1506 | | |
1504 | | - | |
| 1507 | + | |
1505 | 1508 | | |
1506 | 1509 | | |
1507 | 1510 | | |
| |||
0 commit comments