1. 16 5月, 2016 4 次提交
    • G
      drivers/of: Specify parent node in of_fdt_unflatten_tree() · c4263233
      Gavin Shan 提交于
      This adds one more argument to of_fdt_unflatten_tree() to specify
      the parent node of the FDT blob that is going to be unflattened.
      In the result, the function can be used to unflatten FDT blob that
      represents device sub-tree in PowerNV PCI hotplug driver.
      
      Cc: Jyri Sarha <jsarha@ti.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Acked-by: NJyri Sarha <jsarha@ti.com>
      Signed-off-by: NRob Herring <robh@kernel.org>
      c4263233
    • G
      drivers/of: Rename unflatten_dt_node() · 947c82cb
      Gavin Shan 提交于
      This renames unflatten_dt_node() to unflatten_dt_nodes() as it
      populates multiple device nodes from FDT blob. No logical changes
      introduced.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      947c82cb
    • G
      drivers/of: Avoid recursively calling unflatten_dt_node() · 50800082
      Gavin Shan 提交于
      In current implementation, unflatten_dt_node() is called recursively
      to unflatten device nodes in FDT blob. It's stress to limited stack
      capacity, especially to adopt the function to unflatten device sub-tree
      that possibly has multiple root nodes. In that case, we runs out of
      stack and the system can't boot up successfully.
      
      In order to reuse the function to unflatten device sub-tree, this avoids
      calling the function recursively, meaning the device nodes are unflattened
      in one call on unflatten_dt_node(): two arrays are introduced to track the
      parent path size and the device node of current level of depth, which will
      be used by the device node on next level of depth to be unflattened. All
      device nodes in more than 64 level of depth are dropped and hopefully,
      the system can boot up successfully with the partial device-tree.
      
      Also, the parameter "poffset" and "fpsize" are unused and dropped and the
      parameter "dryrun" is figured out from "mem == NULL". Besides, the return
      value of the function is changed to indicate the size of memory consumed by
      the unflatten device tree or error code.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      50800082
    • G
      drivers/of: Split unflatten_dt_node() · dfbd4c6e
      Gavin Shan 提交于
      The function unflatten_dt_node() is called recursively to unflatten
      device nodes and properties in the FDT blob. It looks complicated
      and hard to be understood.
      
      This splits the function into 3 functions: populate_properties(),
      populate_node() and unflatten_dt_node(). populate_properties(),
      which is called by populate_node(), creates properties for the
      indicated device node. The later one creates the device nodes
      from FDT blob. populate_node() gets the offset in FDT blob for
      next device nodes and then calls populate_node(). No logical
      changes introduced.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NRob Herring <robh@kernel.org>
      dfbd4c6e
  2. 02 5月, 2016 1 次提交
    • A
      of: include errno.h in of_graph.h · 011d6f5c
      Arnd Bergmann 提交于
      When CONFIG_OF is disabled, we have to include linux/errno.h before
      including of_graph.h, or get build errors like in the newly added
      sun4i drm driver:
      
      In file included from ../drivers/gpu/drm/sun4i/sun4i_drv.c:14:0:
      include/linux/of_graph.h: In function 'of_graph_parse_endpoint':
      include/linux/of_graph.h:58:10: error: 'ENOSYS' undeclared (first use in this function)
      
      A better solution is to ensure that the header can be included
      by itself, so let's include linux/errno.h here to fix the error
      we just got, and any similar future error.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 9026e0d1 ("drm: Add Allwinner A10 Display Engine support")
      Signed-off-by: NRob Herring <robh@kernel.org>
      011d6f5c
  3. 25 4月, 2016 21 次提交
  4. 20 4月, 2016 14 次提交