• P
    of: device_node kobject lifecycle fixes · 0829f6d1
    Pantelis Antoniou 提交于
    After the move to having device nodes be proper kobjects the lifecycle
    of the node needs to be controlled better.
    
    At first convert of_add_node() in the unflattened functions to
    of_init_node() which initializes the kobject so that of_node_get/put
    work correctly even before of_init is called.
    
    Afterwards introduce of_node_is_initialized & of_node_is_attached that
    query the underlying kobject about the state (attached means kobj
    is visible in sysfs)
    
    Using that make sure the lifecycle of the tree is correct at all
    times.
    Signed-off-by: NPantelis Antoniou <panto@antoniou-consulting.com>
    [grant.likely: moved of_node_init() calls, fixed up locking, and
                   dropped __of_populate() hunks]
    Signed-off-by: NGrant Likely <grant.likely@linaro.org>
    0829f6d1
fdt.c 23.9 KB