• Pantelis Antoniou's avatar
    of: device_node kobject lifecycle fixes · 0829f6d1
    Pantelis Antoniou authored
    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: default avatarPantelis Antoniou <panto@antoniou-consulting.com>
    [grant.likely: moved of_node_init() calls, fixed up locking, and
                   dropped __of_populate() hunks]
    Signed-off-by: default avatarGrant Likely <grant.likely@linaro.org>
    0829f6d1
base.c 56.1 KB