Re: [PATCH] mmc: core: Cleanup unused OF nodes while parsing for child nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30 March 2015 at 15:37, Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> Hi,
>
>
> On 30-03-15 11:19, Ulf Hansson wrote:
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
>> ---
>>   drivers/mmc/core/core.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
>> index c296bc0..e6b0bdb 100644
>> --- a/drivers/mmc/core/core.c
>> +++ b/drivers/mmc/core/core.c
>> @@ -1291,6 +1291,8 @@ struct device_node *mmc_of_find_child_device(struct
>> mmc_host *host,
>>         for_each_child_of_node(host->parent->of_node, node) {
>>                 if (mmc_of_get_func_num(node) == func_num)
>>                         return node;
>> +               else
>> +                       of_node_put(node);
>>         }
>>
>>         return NULL;
>>
>
> I don't think this is right, non of the other users of
> for_each_child_of_node
> do this, I think that rather then doing this we should be changing the
> callers

So, everybody don't follow the API. Cool. :-)

> of mmc_of_find_child_device to do: of_node_get(), except for the call which
> my "mmc: Add support for marking hpi as broken through devicetree" patch
> adds,
> as that is intended to only take a temporary reference.
>

In principle you are saying that the implementation of
for_each_child_of_node() API needs to be adopted for how users
actually use it, which means leave the of_node_get|put() to be done
entirely by the caller, right?

Kind regards
Uffe
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux