linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] of: add of_property_alloc/free() and of_node_alloc()
@ 2022-06-20 10:41 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
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Clément Léger @ 2022-06-20 10:41 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Rob Herring, Frank Rowand, Nathan Lynch, Laurent Dufour,
	Daniel Henrique Barboza, David Gibson, Andrew Morton,
	David Hildenbrand, Ohhoon Kwon, Aneesh Kumar K.V, YueHaibing
  Cc: Clément Léger, linuxppc-dev, linux-kernel, devicetree,
	Allan Nielsen, Horatiu Vultur, Steen Hegelund, Thomas Petazzoni,
	Bjorn Helgaas, Lizhi Hou

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-06-29  7:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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-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-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 ` [PATCH v3 4/5] of: dynamic: add of_node_alloc() 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
     [not found]   ` <a6068e53-80ea-600b-0b54-0a1d0c784c54@csgroup.eu>
2022-06-29  7:30     ` Clément Léger
2022-06-24  4:02 ` [PATCH v3 0/5] of: add " Frank Rowand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).