]> git.baikalelectronics.ru Git - kernel.git/commit
of: device_node kobject lifecycle fixes
authorPantelis Antoniou <panto@antoniou-consulting.com>
Fri, 13 Dec 2013 18:08:59 +0000 (20:08 +0200)
committerGrant Likely <grant.likely@linaro.org>
Wed, 19 Mar 2014 14:58:40 +0000 (14:58 +0000)
commit6308d0bc69f484bbadb5c111e272fcc6d112eaa3
tree4081a4bee4a9e193b4de690735b5a3782d100eac
parentdec5860119572c57c7913033e0571b593c8b1278
of: device_node kobject lifecycle fixes

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: Pantelis Antoniou <panto@antoniou-consulting.com>
[grant.likely: moved of_node_init() calls, fixed up locking, and
               dropped __of_populate() hunks]
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/base.c
drivers/of/fdt.c
drivers/of/pdt.c
include/linux/of.h