diff options
author | 2017-02-06 19:56:14 -0800 | |
---|---|---|
committer | 2017-02-08 18:29:05 +0000 | |
commit | a4d7641fa797b523c0789d2fa55b0a3d53abc2fb (patch) | |
tree | f8cd5387ca87ec469686539d0088825c529d064a /tools/perf/scripts/python/call-graph-from-postgresql.py | |
parent | regulator: core: have regulator_dev_lookup() return ERR_PTR-encoded errors (diff) | |
download | linux-dev-a4d7641fa797b523c0789d2fa55b0a3d53abc2fb.tar.xz linux-dev-a4d7641fa797b523c0789d2fa55b0a3d53abc2fb.zip |
regulator: core: simplify _regulator_get()
The code in _regulator_get() got a bit confusing over time, with control
flow jumping to a label from couple of places. Let's untangle it a bit by
doing the following:
1. Make handling of missing supplies and substituting them with dummy
regulators more explicit:
- check if we not have full constraints and refuse considering dummy
regulators with appropriate message;
- use "switch (get_type)" to handle different types of request explicitly
as well. "Normal" requests will get dummies, exclusive will not and
will notify user about that; optional will fail silently.
2. Stop jumping to a label in the middle of the function but instead have
proper conditional flow. I believe jumps should be reserved for error
handling, breaking from inner loop, or restarting a loop, but not for
implementing normal conditional flow.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/call-graph-from-postgresql.py')
0 files changed, 0 insertions, 0 deletions