summaryrefslogtreecommitdiff
path: root/drivers/sh
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2017-02-06 19:56:14 -0800
committerMark Brown <broonie@kernel.org>2017-02-08 18:29:05 +0000
commita4d7641fa797b523c0789d2fa55b0a3d53abc2fb (patch)
treef8cd5387ca87ec469686539d0088825c529d064a /drivers/sh
parent163478dae0b6ce2437488e54012705b53ef43f3d (diff)
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 'drivers/sh')
0 files changed, 0 insertions, 0 deletions