]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/of: Fix depth for sub-tree blob in unflatten_dt_nodes()
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Thu, 9 Jun 2016 05:50:49 +0000 (15:50 +1000)
committerRob Herring <robh@kernel.org>
Thu, 9 Jun 2016 19:36:34 +0000 (14:36 -0500)
commit831ba22cd422e1b5fa9d5ee92cd0e9c726641be1
tree5180e8610b892fd9993e00996adf98df492c3b53
parentfdf55b058156ad92a621cb831120d20caafc09ba
drivers/of: Fix depth for sub-tree blob in unflatten_dt_nodes()

The function is unflattening device sub-tree blob if @dad passed to
the function is valid. Currently, this functionality is used by PPC
PowerNV PCI hotplug driver only. There are possibly multiple nodes
in the first level of depth, fdt_next_node() bails immediately when
@depth becomes negative before the second device node can be probed
successfully. It leads to the device nodes except the first one won't
be unflattened successfully.

This fixes the issue by setting the initial depth (@inital_depth) to
1 when this function is called to unflatten device sub-tree blob. No
logic changes when this function is used to unflatten non-sub-tree
blob.

Cc: Rhyland Klein <rklein@nvidia.com>
Fixes: 58bf7975f ("drivers/of: Fix depth when unflattening devicetree")
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Tested-by: Rhyland Klein <rklein@nvidia.com>
Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/fdt.c