Re: [PATCH] regulator: remove unnecessary of_node_get() to parent

From: Axel Lin
Date: Wed Sep 10 2014 - 00:23:51 EST


2014-09-10 12:20 GMT+08:00 Axel Lin <axel.lin@xxxxxxxxxx>:
> 2014-09-10 11:50 GMT+08:00 Guodong Xu <guodong.xu@xxxxxxxxxx>:
>> These of_node_get() were added to balance refcount decrements inside of
>> of_find_node_by_name().
>> See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()")
>>
>> However of_find_node_by_name() was then replaced by of_get_child_by_name(),
>> which doesn't call of_node_put() against its input parameter.
>>
>> So, need to remove these unnecessary of_node_get() calls.
>
> The of_node_get() and of_node_put() is a pair.
> You need to either keep both or remove both.
>
>
> BTW,
> I think either the comment of of_get_child_by_name() needs fix or the
> implementation
> needs fix. The implementation does not increment refcount.

Ah, I see the of_node_get() and of_node_put() in __of_get_next_child.
So of_get_child_by_name() is correct.(both comment and implementation)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/