From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B7FAC433F5 for ; Fri, 6 May 2022 10:45:43 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4KvnKK5GNFz3cFy for ; Fri, 6 May 2022 20:45:41 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=BWZ9TvS5; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=bootlin.com (client-ip=217.70.183.198; helo=relay6-d.mail.gandi.net; envelope-from=clement.leger@bootlin.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=BWZ9TvS5; dkim-atps=neutral Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4KvnJh52bpz2xBv for ; Fri, 6 May 2022 20:45:06 +1000 (AEST) Received: (Authenticated sender: clement.leger@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 7862AC000E; Fri, 6 May 2022 10:44:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1651833901; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aGQDY12wXijcoD4wVlIl8GRaAeVSN1VXTWLT8MFX0sY=; b=BWZ9TvS5I2P+CsVnRy3GTaTxbed2YCuizlO9DVt7xjLsa1wbjLJfkk2Per51Q8scCAULM1 6qaLwEtegTL5lDf+ApWcPZCiFNczIenzAHbHUZDe+ZamGFEmL6lv17FXRnUnvYV3qFpnr/ 2iBYMOhBGTVDOaRfNf/R3vktAEPB14JDOO38aMNYZ6XQ3BU7lgUgLKPhLeDABc5oRpscXJ oYV7askBk05jakApkWgW86E7GTFeI1mPyyGC+CTqnBn+VvoH4f2GpucadX5e66P/pRX+XU cM4E+vDjAi4wNdY7+/gSHbeZ/qeWHeEtZQNia8bcJMcUze7GLHbYAZBmoM+7bQ== Date: Fri, 6 May 2022 12:43:39 +0200 From: =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= To: Rob Herring Subject: Re: [PATCH 2/3] of: dynamic: add of_node_alloc() and of_node_free() Message-ID: <20220506124339.2c772fa0@fixe.home> In-Reply-To: References: <20220504154033.750511-1-clement.leger@bootlin.com> <20220504154033.750511-3-clement.leger@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nathan Lynch , devicetree@vger.kernel.org, Ohhoon Kwon , David Hildenbrand , Steen Hegelund , Daniel Henrique Barboza , YueHaibing , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Paul Mackerras , "Aneesh Kumar K.V" , Thomas Petazzoni , Allan Nielsen , Andrew Morton , Laurent Dufour , Frank Rowand , Horatiu Vultur , David Gibson Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Le Thu, 5 May 2022 14:43:54 -0500, Rob Herring a =C3=A9crit : > On Wed, May 04, 2022 at 05:40:32PM +0200, Cl=C3=A9ment L=C3=A9ger wrote: > > Add functions which allows to create and free nodes. > >=20 > > Signed-off-by: Cl=C3=A9ment L=C3=A9ger > > --- > > drivers/of/dynamic.c | 59 ++++++++++++++++++++++++++++++++++++-------- > > include/linux/of.h | 9 +++++++ > > 2 files changed, 58 insertions(+), 10 deletions(-) > >=20 > > diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c > > index e8700e509d2e..ec28e5ba2969 100644 > > --- a/drivers/of/dynamic.c > > +++ b/drivers/of/dynamic.c > > @@ -455,6 +455,54 @@ struct property *__of_prop_dup(const struct proper= ty *prop, gfp_t allocflags) > > prop->length, allocflags); > > } > > =20 > > +/** > > + * of_node_free - Free a node allocated dynamically. > > + * @node: Node to be freed > > + */ > > +void of_node_free(const struct device_node *node) > > +{ > > + kfree(node->full_name); > > + kfree(node->data); > > + kfree(node); > > +} > > +EXPORT_SYMBOL(of_node_free); =20 >=20 > This shouldn't be needed. Nodes are refcounted, so any caller should=20 > just do a put. Acked. Do you want the name to be allocated as part of the node allocation also ? >=20 > Rob --=20 Cl=C3=A9ment L=C3=A9ger, Embedded Linux and Kernel engineer at Bootlin https://bootlin.com