Use of of_parse_phandle()/of_node_put()

Peter Ujfalusi peter.ujfalusi at ti.com
Thu Feb 14 20:26:41 EST 2013


On 02/13/2013 06:02 PM, Anil Kumar wrote:
> ------------8---------------
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index b7e84a7..9000f4a 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1044,6 +1044,13 @@ static void soc_remove_dai_links(struct
> snd_soc_card *card)
>                         soc_remove_link_dais(card, dai, order);
>         }
> 
> +       /* release cpu_of_node */
> +       if(card->dai_link) {
> +               int i;
> +               for(i = 0; i < card->num_links; i++)
> +                       of_node_put(card->dai_link[i].cpu_of_node);

and the same for codec_of_node and platform_of_node for that matter.

Mark: what do you think? Does it make sense to do this in the core or should
we let the machine drivers to take care of this?

> +       }
> +
> 

-- 
Péter


More information about the devicetree-discuss mailing list