Patch "regulator: change stubbed devm_regulator_get_enable to return Ok" 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

    regulator: change stubbed devm_regulator_get_enable to return Ok

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:
     regulator-change-stubbed-devm_regulator_get_enable-t.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 4e3d255f6b10dba8bcff1909bb15e9e48d28ffaf
Author: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
Date:   Mon Apr 22 09:38:33 2024 +0300

    regulator: change stubbed devm_regulator_get_enable to return Ok
    
    [ Upstream commit 96e20adc43c4f81e9163a5188cee75a6dd393e09 ]
    
    The devm_regulator_get_enable() should be a 'call and forget' API,
    meaning, when it is used to enable the regulators, the API does not
    provide a handle to do any further control of the regulators. It gives
    no real benefit to return an error from the stub if CONFIG_REGULATOR is
    not set.
    
    On the contrary, returning and error is causing problems to drivers when
    hardware is such it works out just fine with no regulator control.
    Returning an error forces drivers to specifically handle the case where
    CONFIG_REGULATOR is not set, making the mere existence of the stub
    questionalble. Furthermore, the stub of the regulator_enable() seems to
    be returning Ok.
    
    Change the stub implementation for the devm_regulator_get_enable() to
    return Ok so drivers do not separately handle the case where the
    CONFIG_REGULATOR is not set.
    
    Signed-off-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
    Reported-by: Aleksander Mazur <deweloper@xxxxx>
    Suggested-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Fixes: da279e6965b3 ("regulator: Add devm helpers for get and enable")
    Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/ZiYF6d1V1vSPcsJS@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index ee3b4a0146119..eea165685588a 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -361,7 +361,7 @@ devm_regulator_get_exclusive(struct device *dev, const char *id)
 
 static inline int devm_regulator_get_enable(struct device *dev, const char *id)
 {
-	return -ENODEV;
+	return 0;
 }
 
 static inline int devm_regulator_get_enable_optional(struct device *dev,




[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