devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * [PATCH 3/5] of/device: Make of_get_next_child() check status properties
           [not found] <cover.1291799069.git.deepak_saxena@mentor.com>
           [not found] ` <cover.1291799069.git.deepak_saxena-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
    @ 2010-12-08 19:29 ` Deepak Saxena
      2010-12-08 21:01   ` Scott Wood
      1 sibling, 1 reply; 13+ messages in thread
    From: Deepak Saxena @ 2010-12-08 19:29 UTC (permalink / raw)
      To: devicetree-discuss; +Cc: linuxppc-dev
    
    We only return the next child if the device is available.
    
    Signed-off-by: Hollis Blanchard <hollis_blanchard@mentor.com>
    Signed-off-by: Deepak Saxena <deepak_saxena@mentor.com>
    ---
     drivers/of/base.c |    4 +++-
     1 files changed, 3 insertions(+), 1 deletions(-)
    
    diff --git a/drivers/of/base.c b/drivers/of/base.c
    index 5d269a4..81b2601 100644
    --- a/drivers/of/base.c
    +++ b/drivers/of/base.c
    @@ -321,6 +321,8 @@ struct device_node *of_get_next_parent(struct device_node *node)
      *
      *	Returns a node pointer with refcount incremented, use
      *	of_node_put() on it when done.
    + *
    + *	Does not return nodes marked unavailable by a status property.
      */
     struct device_node *of_get_next_child(const struct device_node *node,
     	struct device_node *prev)
    @@ -330,7 +332,7 @@ struct device_node *of_get_next_child(const struct device_node *node,
     	read_lock(&devtree_lock);
     	next = prev ? prev->sibling : node->child;
     	for (; next; next = next->sibling)
    -		if (of_node_get(next))
    +		if (of_device_is_available(next) && of_node_get(next))
     			break;
     	of_node_put(prev);
     	read_unlock(&devtree_lock);
    -- 
    1.6.3.3
    
    ^ permalink raw reply related	[flat|nested] 13+ messages in thread

  • end of thread, other threads:[~2010-12-31  7:46 UTC | newest]
    
    Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <cover.1291799069.git.deepak_saxena@mentor.com>
         [not found] ` <cover.1291799069.git.deepak_saxena-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
    2010-12-08 19:29   ` [PATCH 1/5] of/device: Centralize checking of 'status' properties Deepak Saxena
    2010-12-31  7:43     ` Grant Likely
    2010-12-08 19:29   ` [PATCH 4/5] of/device: Create _of_get_next_child() Deepak Saxena
    2010-12-08 19:29   ` [PATCH 5/5] of/device: Show even unavailable nodes in procfs Deepak Saxena
    2010-12-08 19:29   ` [PATCH 2/5] of/device: make for_each_node* check status properties Deepak Saxena
         [not found]     ` <20101208192957.GF32473-nmGgyN9QBj3QT0dZR+AlfA@public.gmane.org>
    2010-12-31  7:46       ` Grant Likely
    2010-12-08 19:29 ` [PATCH 3/5] of/device: Make of_get_next_child() " Deepak Saxena
    2010-12-08 21:01   ` Scott Wood
         [not found]     ` <20101208150102.69b8062b-N/eSCTBpGwP7j4BuCOFQISmX4OfbXNuMKnGXBo5VDl8@public.gmane.org>
    2010-12-09  1:33       ` Michael Ellerman
    2010-12-09  3:09         ` David Gibson
    2010-12-15 18:35           ` Hollis Blanchard
    2010-12-15 22:40             ` Michael Ellerman
    2010-12-31  7:39               ` Grant Likely
    

    This is a public inbox, see mirroring instructions
    for how to clone and mirror all data and code used for this inbox;
    as well as URLs for NNTP newsgroup(s).