All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clément Léger" <clement.leger@bootlin.com>
To: Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Allan Nielsen" <allan.nielsen@microchip.com>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	"Clément Léger" <clement.leger@bootlin.com>
Subject: [PATCH 1/2] of: add function to convert fwnode_reference_args to of_phandle_args
Date: Wed, 23 Mar 2022 10:50:21 +0100	[thread overview]
Message-ID: <20220323095022.453708-2-clement.leger@bootlin.com> (raw)
In-Reply-To: <20220323095022.453708-1-clement.leger@bootlin.com>

Add of_phandle_args_from_fwnode_reference_args() which convert a struct
fwnode_reference_args to an of_phandle_args. This is used to maintain
compatibility for device-tree specifiers translation functions that are
used by various subsystem.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 include/linux/of.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/linux/of.h b/include/linux/of.h
index 2dc77430a91a..1f6c8927c5ff 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -175,6 +175,18 @@ static inline bool is_of_node(const struct fwnode_handle *fwnode)
 			&__of_fwnode_handle_node->fwnode : NULL;	\
 	})
 
+static inline void
+of_phandle_args_from_fwnode_reference_args(struct of_phandle_args *of_args,
+					   const struct fwnode_reference_args *fwnode_args)
+{
+	int i;
+
+	of_args->np = to_of_node(fwnode_args->fwnode);
+	of_args->args_count = fwnode_args->nargs;
+	for (i = 0; i < fwnode_args->nargs; i++)
+		of_args->args[i] = fwnode_args->args[i];
+}
+
 static inline bool of_have_populated_dt(void)
 {
 	return of_root != NULL;
@@ -543,6 +555,12 @@ static inline struct device_node *of_find_node_with_property(
 
 #define of_fwnode_handle(node) NULL
 
+static inline void
+of_phandle_args_from_fwnode_reference_args(struct of_phandle_args *of_args,
+					   const struct fwnode_reference_args *fwnode_args)
+{
+}
+
 static inline bool of_have_populated_dt(void)
 {
 	return false;
-- 
2.34.1


  reply	other threads:[~2022-03-23 10:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23  9:50 [PATCH 0/2] add fwnode support to reset subsystem Clément Léger
2022-03-23  9:50 ` Clément Léger [this message]
2022-03-23  9:50 ` [PATCH 2/2] reset: add support for fwnode Clément Léger
2022-03-23 15:29   ` Philipp Zabel
2022-03-23 16:21     ` Clément Léger
2022-03-24  9:19       ` Clément Léger
2022-03-24  9:39         ` Philipp Zabel
2022-03-24  9:44       ` Philipp Zabel
2022-03-23 15:07 ` [PATCH 0/2] add fwnode support to reset subsystem Philipp Zabel
2022-03-23 16:05   ` Clément Léger
2022-03-24 10:08     ` Philipp Zabel
2022-03-24 10:16       ` Clément Léger

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=20220323095022.453708-2-clement.leger@bootlin.com \
    --to=clement.leger@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=thomas.petazzoni@bootlin.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: link
Be 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.