lkml.org 
[lkml]   [2013]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 020/118] regulator: fixed regulator_bulk_enable unwinding code
    Date
    3.5.7.12 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Andrzej Hajda <a.hajda@samsung.com>

    commit fbe31057fafebdc2811a7101b8b4a0460f5417d1 upstream.

    Unwinding code disables all successfully enabled regulators.
    Error is logged for every failed regulator.

    Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
    Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    drivers/regulator/core.c | 10 +++++++---
    1 file changed, 7 insertions(+), 3 deletions(-)

    diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
    index 8b4b382..4a4d12e 100644
    --- a/drivers/regulator/core.c
    +++ b/drivers/regulator/core.c
    @@ -2769,9 +2769,13 @@ int regulator_bulk_enable(int num_consumers,
    return 0;

    err:
    - pr_err("Failed to enable %s: %d\n", consumers[i].supply, ret);
    - while (--i >= 0)
    - regulator_disable(consumers[i].consumer);
    + for (i = 0; i < num_consumers; i++) {
    + if (consumers[i].ret < 0)
    + pr_err("Failed to enable %s: %d\n", consumers[i].supply,
    + consumers[i].ret);
    + else
    + regulator_disable(consumers[i].consumer);
    + }

    return ret;
    }
    --
    1.8.1.2


    \
     
     \ /
      Last update: 2013-05-07 17:21    [W:2.502 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site