Patch "mfd: stmfx: Nullify stmfx->vdd in case of error" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    mfd: stmfx: Nullify stmfx->vdd in case of error

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     mfd-stmfx-nullify-stmfx-vdd-in-case-of-error.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0cacb5dc39c5f84d901869628aaa2c86e43337a6
Author: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
Date:   Fri Jun 9 11:28:04 2023 +0200

    mfd: stmfx: Nullify stmfx->vdd in case of error
    
    [ Upstream commit 7c81582c0bccb4757186176f0ee12834597066ad ]
    
    Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error.
    And simplify code by returning an error only if return code is not -ENODEV,
    which means there is no vdd regulator and it is not an issue.
    
    Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()")
    Signed-off-by: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230609092804.793100-2-amelie.delaunay@xxxxxxxxxxx
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index 61a8aad564a4e..b1ecd85ad2a8a 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -330,9 +330,8 @@ static int stmfx_chip_init(struct i2c_client *client)
 	stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd");
 	ret = PTR_ERR_OR_ZERO(stmfx->vdd);
 	if (ret) {
-		if (ret == -ENODEV)
-			stmfx->vdd = NULL;
-		else
+		stmfx->vdd = NULL;
+		if (ret != -ENODEV)
 			return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n");
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux