lkml.org 
[lkml]   [2019]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 069/125] regulator: tps65910: fix a missing check of return value
    Date
    From: Kangjie Lu <kjlu@umn.edu>

    [ Upstream commit cd07e3701fa6a4c68f8493ee1d12caa18d46ec6a ]

    tps65910_reg_set_bits() may fail. The fix checks if it fails, and if so,
    returns with its error code.

    Signed-off-by: Kangjie Lu <kjlu@umn.edu>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/regulator/tps65910-regulator.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
    index 696116ebdf50a..9cde7b0757011 100644
    --- a/drivers/regulator/tps65910-regulator.c
    +++ b/drivers/regulator/tps65910-regulator.c
    @@ -1102,8 +1102,10 @@ static int tps65910_probe(struct platform_device *pdev)
    platform_set_drvdata(pdev, pmic);

    /* Give control of all register to control port */
    - tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL,
    + err = tps65910_reg_set_bits(pmic->mfd, TPS65910_DEVCTRL,
    DEVCTRL_SR_CTL_I2C_SEL_MASK);
    + if (err < 0)
    + return err;

    switch (tps65910_chip_id(tps65910)) {
    case TPS65910:
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-12-04 19:13    [W:4.361 / U:1.208 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site