Patch "mfd: mfd-core: Honour Device Tree's request to disable a child-device" has been added to the 4.4-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: mfd-core: Honour Device Tree's request to disable a child-device

to the 4.4-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-mfd-core-honour-device-tree-s-request-to-disable.patch
and it can be found in the queue-4.4 subdirectory.

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



commit 6ebc41f96e8756fa51c46ebe291c092b99253905
Author: Lee Jones <lee.jones@xxxxxxxxxx>
Date:   Thu Nov 7 11:19:50 2019 +0000

    mfd: mfd-core: Honour Device Tree's request to disable a child-device
    
    [ Upstream commit 6b5c350648b857047b47acf74a57087ad27d6183 ]
    
    Until now, MFD has assumed all child devices passed to it (via
    mfd_cells) are to be registered. It does not take into account
    requests from Device Tree and the like to disable child devices
    on a per-platform basis.
    
    Well now it does.
    
    Link: https://www.spinics.net/lists/arm-kernel/msg366309.html
    Link: https://lkml.org/lkml/2019/8/22/1350
    
    Reported-by: Barry Song <Baohua.Song@xxxxxxx>
    Reported-by: Stephan Gerhold <stephan@xxxxxxxxxxx>
    Reviewed-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
    Reviewed-by: Mark Brown <broonie@xxxxxxxxxx>
    Tested-by: Stephan Gerhold <stephan@xxxxxxxxxxx>
    Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 215bb5eeb5ac..85f4e5582371 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -177,6 +177,11 @@ static int mfd_add_device(struct device *parent, int id,
 	if (parent->of_node && cell->of_compatible) {
 		for_each_child_of_node(parent->of_node, np) {
 			if (of_device_is_compatible(np, cell->of_compatible)) {
+				if (!of_device_is_available(np)) {
+					/* Ignore disabled devices error free */
+					ret = 0;
+					goto fail_alias;
+				}
 				pdev->dev.of_node = np;
 				pdev->dev.fwnode = &np->fwnode;
 				break;



[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