From: "Clément Léger" <clement.leger@bootlin.com> To: Michael Ellerman <mpe@ellerman.id.au>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Nathan Lynch <nathanl@linux.ibm.com>, Laurent Dufour <ldufour@linux.ibm.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, Ohhoon Kwon <ohoono.kwon@samsung.com>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, YueHaibing <yuehaibing@huawei.com> Cc: "Clément Léger" <clement.leger@bootlin.com>, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, "Allan Nielsen" <allan.nielsen@microchip.com>, "Horatiu Vultur" <horatiu.vultur@microchip.com>, "Steen Hegelund" <steen.hegelund@microchip.com>, "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>, "Bjorn Helgaas" <helgaas@kernel.org>, "Lizhi Hou" <lizhi.hou@xilinx.com> Subject: [PATCH v3 0/5] of: add of_property_alloc/free() and of_node_alloc() Date: Mon, 20 Jun 2022 12:41:18 +0200 [thread overview] Message-ID: <20220620104123.341054-1-clement.leger@bootlin.com> (raw) In order to be able to create new nodes and properties dynamically from drivers, add of_property_alloc/free() and of_node_alloc(). These functions can be used to create new nodes and properties flagged with OF_DYNAMIC and to free them. Some powerpc code was already doing such operations and thus, these functions have been used to replace the manual creation of nodes and properties. This code has been more than simply replaced to allow using of_node_put() rather than a manual deletion of the properties. Unfortunately, as I don't own a powerpc platform, it would need to be tested. --- Changes in V3: - Remove gfpflag attribute from of_node_alloc() and of_property_alloc(). - Removed allocflags from __of_node_dup(). - Rework powerpc code to only use of_node_put(). - Fix properties free using of_node_property in OF unittests. Changes in V2: - Remove of_node_free() - Rework property allocation to allocate both property and value with 1 allocation - Rework node allocation to allocate name at the same time the node is allocated - Remove extern from definitions - Remove of_property_alloc() value_len parameter and add more explanation for the arguments - Add a check in of_property_free to check OF_DYNAMIC flag - Add a commit which constify the property argument of of_property_check_flags() Clément Léger (5): of: constify of_property_check_flags() prop argument of: remove __of_node_dup() allocflags parameter of: dynamic: add of_property_alloc() and of_property_free() of: dynamic: add of_node_alloc() powerpc/pseries: use of_property_alloc/free() and of_node_alloc() arch/powerpc/platforms/pseries/dlpar.c | 62 +------- .../platforms/pseries/hotplug-memory.c | 21 +-- arch/powerpc/platforms/pseries/reconfig.c | 123 ++++++---------- drivers/of/dynamic.c | 137 ++++++++++++------ drivers/of/of_private.h | 19 ++- drivers/of/overlay.c | 2 +- drivers/of/unittest.c | 24 ++- include/linux/of.h | 24 ++- 8 files changed, 191 insertions(+), 221 deletions(-) -- 2.36.1
WARNING: multiple messages have this Message-ID (diff)
From: "Clément Léger" <clement.leger@bootlin.com> To: Michael Ellerman <mpe@ellerman.id.au>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Paul Mackerras <paulus@samba.org>, Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>, Nathan Lynch <nathanl@linux.ibm.com>, Laurent Dufour <ldufour@linux.ibm.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Andrew Morton <akpm@linux-foundation.org>, David Hildenbrand <david@redhat.com>, Ohhoon Kwon <ohoono.kwon@samsung.com>, "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>, YueHaibing <yuehaibing@huawei.com> Cc: devicetree@vger.kernel.org, "Clément Léger" <clement.leger@bootlin.com>, "Steen Hegelund" <steen.hegelund@microchip.com>, linux-kernel@vger.kernel.org, "Lizhi Hou" <lizhi.hou@xilinx.com>, "Allan Nielsen" <allan.nielsen@microchip.com>, "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>, "Bjorn Helgaas" <helgaas@kernel.org>, linuxppc-dev@lists.ozlabs.org, "Horatiu Vultur" <horatiu.vultur@microchip.com> Subject: [PATCH v3 0/5] of: add of_property_alloc/free() and of_node_alloc() Date: Mon, 20 Jun 2022 12:41:18 +0200 [thread overview] Message-ID: <20220620104123.341054-1-clement.leger@bootlin.com> (raw) In order to be able to create new nodes and properties dynamically from drivers, add of_property_alloc/free() and of_node_alloc(). These functions can be used to create new nodes and properties flagged with OF_DYNAMIC and to free them. Some powerpc code was already doing such operations and thus, these functions have been used to replace the manual creation of nodes and properties. This code has been more than simply replaced to allow using of_node_put() rather than a manual deletion of the properties. Unfortunately, as I don't own a powerpc platform, it would need to be tested. --- Changes in V3: - Remove gfpflag attribute from of_node_alloc() and of_property_alloc(). - Removed allocflags from __of_node_dup(). - Rework powerpc code to only use of_node_put(). - Fix properties free using of_node_property in OF unittests. Changes in V2: - Remove of_node_free() - Rework property allocation to allocate both property and value with 1 allocation - Rework node allocation to allocate name at the same time the node is allocated - Remove extern from definitions - Remove of_property_alloc() value_len parameter and add more explanation for the arguments - Add a check in of_property_free to check OF_DYNAMIC flag - Add a commit which constify the property argument of of_property_check_flags() Clément Léger (5): of: constify of_property_check_flags() prop argument of: remove __of_node_dup() allocflags parameter of: dynamic: add of_property_alloc() and of_property_free() of: dynamic: add of_node_alloc() powerpc/pseries: use of_property_alloc/free() and of_node_alloc() arch/powerpc/platforms/pseries/dlpar.c | 62 +------- .../platforms/pseries/hotplug-memory.c | 21 +-- arch/powerpc/platforms/pseries/reconfig.c | 123 ++++++---------- drivers/of/dynamic.c | 137 ++++++++++++------ drivers/of/of_private.h | 19 ++- drivers/of/overlay.c | 2 +- drivers/of/unittest.c | 24 ++- include/linux/of.h | 24 ++- 8 files changed, 191 insertions(+), 221 deletions(-) -- 2.36.1
next reply other threads:[~2022-06-20 10:43 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-20 10:41 Clément Léger [this message] 2022-06-20 10:41 ` [PATCH v3 0/5] of: add of_property_alloc/free() and of_node_alloc() Clément Léger 2022-06-20 10:41 ` [PATCH v3 1/5] of: constify of_property_check_flags() prop argument Clément Léger 2022-06-20 10:41 ` Clément Léger 2022-06-27 17:19 ` Rob Herring 2022-06-27 17:19 ` Rob Herring 2022-06-20 10:41 ` [PATCH v3 2/5] of: remove __of_node_dup() allocflags parameter Clément Léger 2022-06-20 10:41 ` Clément Léger 2022-06-21 17:15 ` Bjorn Helgaas 2022-06-21 17:15 ` Bjorn Helgaas 2022-06-20 10:41 ` [PATCH v3 3/5] of: dynamic: add of_property_alloc() and of_property_free() Clément Léger 2022-06-20 10:41 ` Clément Léger 2022-06-20 10:41 ` [PATCH v3 4/5] of: dynamic: add of_node_alloc() Clément Léger 2022-06-20 10:41 ` Clément Léger 2022-06-20 10:41 ` [PATCH v3 5/5] powerpc/pseries: use of_property_alloc/free() and of_node_alloc() Clément Léger 2022-06-20 10:41 ` Clément Léger 2022-06-28 17:00 ` Christophe Leroy 2022-06-29 7:30 ` Clément Léger 2022-06-29 7:30 ` Clément Léger 2022-06-24 4:02 ` [PATCH v3 0/5] of: add " Frank Rowand 2022-06-24 4:02 ` Frank Rowand
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220620104123.341054-1-clement.leger@bootlin.com \ --to=clement.leger@bootlin.com \ --cc=akpm@linux-foundation.org \ --cc=allan.nielsen@microchip.com \ --cc=aneesh.kumar@linux.ibm.com \ --cc=benh@kernel.crashing.org \ --cc=danielhb413@gmail.com \ --cc=david@gibson.dropbear.id.au \ --cc=david@redhat.com \ --cc=devicetree@vger.kernel.org \ --cc=frowand.list@gmail.com \ --cc=helgaas@kernel.org \ --cc=horatiu.vultur@microchip.com \ --cc=ldufour@linux.ibm.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=lizhi.hou@xilinx.com \ --cc=mpe@ellerman.id.au \ --cc=nathanl@linux.ibm.com \ --cc=ohoono.kwon@samsung.com \ --cc=paulus@samba.org \ --cc=robh+dt@kernel.org \ --cc=steen.hegelund@microchip.com \ --cc=thomas.petazzoni@bootlin.com \ --cc=yuehaibing@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.