All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] of: dynamic: Add __of_node_dupv()
@ 2016-11-04 14:42 Hans de Goede
       [not found] ` <20161104144241.18002-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Hans de Goede @ 2016-11-04 14:42 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, Pantelis Antoniou
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Hans de Goede

From: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

Add an __of_node_dupv() private method and make __of_node_dup() use it.
This is required for the subsequent changeset accessors which will
make use of it.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
Changes in v2 (hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org):
-No changes (unmodified preparation patch)
---
 drivers/of/dynamic.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 888fdbc..cc64675 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -397,8 +397,9 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
 }
 
 /**
- * __of_node_dup() - Duplicate or create an empty device node dynamically.
- * @fmt: Format string (plus vargs) for new full name of the device node
+ * __of_node_dupv() - Duplicate or create an empty device node dynamically.
+ * @fmt: Format string for new full name of the device node
+ * @vargs: va_list containing the arugments for the node full name
  *
  * Create an device tree node, either by duplicating an empty node or by allocating
  * an empty one suitable for further modification.  The node data are
@@ -406,17 +407,15 @@ struct property *__of_prop_dup(const struct property *prop, gfp_t allocflags)
  * OF_DETACHED bits set. Returns the newly allocated node or NULL on out of
  * memory error.
  */
-struct device_node *__of_node_dup(const struct device_node *np, const char *fmt, ...)
+struct device_node *__of_node_dupv(const struct device_node *np,
+		const char *fmt, va_list vargs)
 {
-	va_list vargs;
 	struct device_node *node;
 
 	node = kzalloc(sizeof(*node), GFP_KERNEL);
 	if (!node)
 		return NULL;
-	va_start(vargs, fmt);
 	node->full_name = kvasprintf(GFP_KERNEL, fmt, vargs);
-	va_end(vargs);
 	if (!node->full_name) {
 		kfree(node);
 		return NULL;
@@ -448,6 +447,24 @@ struct device_node *__of_node_dup(const struct device_node *np, const char *fmt,
 	return NULL;
 }
 
+/**
+ * __of_node_dup() - Duplicate or create an empty device node dynamically.
+ * @fmt: Format string (plus vargs) for new full name of the device node
+ *
+ * See: __of_node_dupv()
+ */
+struct device_node *__of_node_dup(const struct device_node *np,
+		const char *fmt, ...)
+{
+	va_list vargs;
+	struct device_node *node;
+
+	va_start(vargs, fmt);
+	node = __of_node_dupv(np, fmt, vargs);
+	va_end(vargs);
+	return node;
+}
+
 static void __of_changeset_entry_destroy(struct of_changeset_entry *ce)
 {
 	of_node_put(ce->np);
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 24+ messages in thread
* [PATCH v2 0/2] of: Dynamic DT updates
@ 2015-09-16 16:11 Pantelis Antoniou
  2015-09-16 16:11 ` [PATCH v2 2/2] of: changesets: Introduce changeset helper methods Pantelis Antoniou
  0 siblings, 1 reply; 24+ messages in thread
From: Pantelis Antoniou @ 2015-09-16 16:11 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Rowand, Matt Porter, Koen Kooi, Guenter Roeck, devicetree,
	linux-kernel, Pantelis Antoniou, Pantelis Antoniou

The two patches add a new API for using changeset which
makes things considerably easier.

This patchset applies against Linus's tree as of today and
is dependent on the previous patchset I've send out earlier.
"of: overlay: kobject & sysfs'ation"

Changes since v1:
* Dropped the indirect and target root patches until we
figure out what to do with the DT connector.

Pantelis Antoniou (2):
  of: dynamic: Add __of_node_dupv()
  of: changesets: Introduce changeset helper methods

 drivers/of/dynamic.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++--
 include/linux/of.h   |  74 ++++++++++++++
 2 files changed, 348 insertions(+), 6 deletions(-)

-- 
1.7.12


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

end of thread, other threads:[~2016-11-15  5:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-04 14:42 [PATCH v2 1/2] of: dynamic: Add __of_node_dupv() Hans de Goede
     [not found] ` <20161104144241.18002-1-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-04 14:42   ` [PATCH v2 2/2] of: changesets: Introduce changeset helper methods Hans de Goede
     [not found]     ` <20161104144241.18002-2-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-13  2:15       ` Frank Rowand
     [not found]         ` <5827CCC3.90003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-13  8:14           ` Hans de Goede
2016-11-14  7:34           ` Frank Rowand
     [not found]             ` <582968FA.4020800-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-14 11:04               ` Hans de Goede
     [not found]                 ` <b2cef3fb-cbb4-f34b-cb9a-84578bb67751-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-11-14 18:44                   ` Frank Rowand
     [not found]                     ` <582A060D.50800-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-14 22:16                       ` Rob Herring
     [not found]                         ` <CAL_Jsq+zWiXOtb4hWrpB87z8T4WLfCbLeGNgST4tmAz61dgFHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-11-15  1:56                           ` Frank Rowand
     [not found]                             ` <582A6B69.4070704-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-15  5:17                               ` Frank Rowand
  -- strict thread matches above, loose matches on Subject: below --
2015-09-16 16:11 [PATCH v2 0/2] of: Dynamic DT updates Pantelis Antoniou
2015-09-16 16:11 ` [PATCH v2 2/2] of: changesets: Introduce changeset helper methods Pantelis Antoniou
2015-09-17 14:13   ` Rob Herring
2015-09-17 14:13     ` Rob Herring
2015-09-18  9:15     ` Pantelis Antoniou
2015-09-18 14:24       ` Rob Herring
2015-09-21 12:35   ` Geert Uytterhoeven
2015-09-21 12:35     ` Geert Uytterhoeven
2015-09-21 12:36     ` Pantelis Antoniou
2015-09-21 12:36       ` Pantelis Antoniou
2015-09-21 12:47       ` Geert Uytterhoeven
2015-09-21 12:47         ` Geert Uytterhoeven
2015-09-21 12:49         ` Pantelis Antoniou
2015-09-21 13:07           ` Geert Uytterhoeven
2015-09-21 13:11             ` Pantelis Antoniou

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.