Patch "mfd: stmpe: Only disable the regulators if they are enabled" has been added to the 5.10-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: stmpe: Only disable the regulators if they are enabled

to the 5.10-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-stmpe-only-disable-the-regulators-if-they-are-en.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 7ec1dce25fc5e8d18cc84cc256ba978368c5ac15
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sat Jun 17 12:43:16 2023 +0200

    mfd: stmpe: Only disable the regulators if they are enabled
    
    [ Upstream commit 104d32bd81f620bb9f67fbf7d1159c414e89f05f ]
    
    In stmpe_probe(), if some regulator_enable() calls fail, probing continues
    and there is only a dev_warn().
    
    So, if stmpe_probe() is called the regulator may not be enabled. It is
    cleaner to test it before calling regulator_disable() in the remove
    function.
    
    Fixes: 9c9e321455fb ("mfd: stmpe: add optional regulators")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/8de3aaf297931d655b9ad6aed548f4de8b85425a.1686998575.git.christophe.jaillet@xxxxxxxxxx
    Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index 508349399f8af..7f758fb60c1fa 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1494,9 +1494,9 @@ int stmpe_probe(struct stmpe_client_info *ci, enum stmpe_partnum partnum)
 
 int stmpe_remove(struct stmpe *stmpe)
 {
-	if (!IS_ERR(stmpe->vio))
+	if (!IS_ERR(stmpe->vio) && regulator_is_enabled(stmpe->vio))
 		regulator_disable(stmpe->vio);
-	if (!IS_ERR(stmpe->vcc))
+	if (!IS_ERR(stmpe->vcc) && regulator_is_enabled(stmpe->vcc))
 		regulator_disable(stmpe->vcc);
 
 	__stmpe_disable(stmpe, STMPE_BLOCK_ADC);



[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