* [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args
@ 2020-09-10 16:26 Patrick Delaunay
2020-09-17 1:09 ` Simon Glass
2020-09-27 1:59 ` Simon Glass
0 siblings, 2 replies; 3+ messages in thread
From: Patrick Delaunay @ 2020-09-10 16:26 UTC (permalink / raw)
To: u-boot
In the live tree API ofnode_parse_phandle_with_args, the cell_count
argument must be used when cells_name is NULL.
But this argument is not provided to the live DT function
of_parse_phandle_with_args even it is provided to
fdtdec_parse_phandle_with_args.
This patch adds support of the cells_count parameter in dev_ and
of_node API to allow migration and support of live DT:
- of_parse_phandle_with_args
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
drivers/core/of_access.c | 7 ++++---
drivers/core/ofnode.c | 3 ++-
include/dm/of_access.h | 4 +++-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/core/of_access.c b/drivers/core/of_access.c
index 922e78f99b..bcf1644d05 100644
--- a/drivers/core/of_access.c
+++ b/drivers/core/of_access.c
@@ -745,13 +745,14 @@ struct device_node *of_parse_phandle(const struct device_node *np,
int of_parse_phandle_with_args(const struct device_node *np,
const char *list_name, const char *cells_name,
- int index, struct of_phandle_args *out_args)
+ int cell_count, int index,
+ struct of_phandle_args *out_args)
{
if (index < 0)
return -EINVAL;
- return __of_parse_phandle_with_args(np, list_name, cells_name, 0,
- index, out_args);
+ return __of_parse_phandle_with_args(np, list_name, cells_name,
+ cell_count, index, out_args);
}
int of_count_phandle_with_args(const struct device_node *np,
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index d02d8d33fe..79fcdf5ce2 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -409,7 +409,8 @@ int ofnode_parse_phandle_with_args(ofnode node, const char *list_name,
int ret;
ret = of_parse_phandle_with_args(ofnode_to_np(node),
- list_name, cells_name, index,
+ list_name, cells_name,
+ cell_count, index,
&args);
if (ret)
return ret;
diff --git a/include/dm/of_access.h b/include/dm/of_access.h
index f95a00d065..2fa65c9332 100644
--- a/include/dm/of_access.h
+++ b/include/dm/of_access.h
@@ -407,6 +407,7 @@ struct device_node *of_parse_phandle(const struct device_node *np,
* @np: pointer to a device tree node containing a list
* @list_name: property name that contains a list
* @cells_name: property name that specifies phandles' arguments count
+ * @cells_count: Cell count to use if @cells_name is NULL
* @index: index of a phandle to parse out
* @out_args: optional pointer to output arguments structure (will be filled)
* @return 0 on success (with @out_args filled out if not NULL), -ENOENT if
@@ -440,7 +441,8 @@ struct device_node *of_parse_phandle(const struct device_node *np,
*/
int of_parse_phandle_with_args(const struct device_node *np,
const char *list_name, const char *cells_name,
- int index, struct of_phandle_args *out_args);
+ int cells_count, int index,
+ struct of_phandle_args *out_args);
/**
* of_count_phandle_with_args() - Count the number of phandle in a list
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args
2020-09-10 16:26 [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args Patrick Delaunay
@ 2020-09-17 1:09 ` Simon Glass
2020-09-27 1:59 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-09-17 1:09 UTC (permalink / raw)
To: u-boot
On Thu, 10 Sep 2020 at 10:26, Patrick Delaunay <patrick.delaunay@st.com> wrote:
>
> In the live tree API ofnode_parse_phandle_with_args, the cell_count
> argument must be used when cells_name is NULL.
>
> But this argument is not provided to the live DT function
> of_parse_phandle_with_args even it is provided to
> fdtdec_parse_phandle_with_args.
>
> This patch adds support of the cells_count parameter in dev_ and
> of_node API to allow migration and support of live DT:
> - of_parse_phandle_with_args
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> drivers/core/of_access.c | 7 ++++---
> drivers/core/ofnode.c | 3 ++-
> include/dm/of_access.h | 4 +++-
> 3 files changed, 9 insertions(+), 5 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args
2020-09-10 16:26 [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args Patrick Delaunay
2020-09-17 1:09 ` Simon Glass
@ 2020-09-27 1:59 ` Simon Glass
1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2020-09-27 1:59 UTC (permalink / raw)
To: u-boot
On Thu, 10 Sep 2020 at 10:26, Patrick Delaunay <patrick.delaunay@st.com> wrote:
>
> In the live tree API ofnode_parse_phandle_with_args, the cell_count
> argument must be used when cells_name is NULL.
>
> But this argument is not provided to the live DT function
> of_parse_phandle_with_args even it is provided to
> fdtdec_parse_phandle_with_args.
>
> This patch adds support of the cells_count parameter in dev_ and
> of_node API to allow migration and support of live DT:
> - of_parse_phandle_with_args
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> drivers/core/of_access.c | 7 ++++---
> drivers/core/ofnode.c | 3 ++-
> include/dm/of_access.h | 4 +++-
> 3 files changed, 9 insertions(+), 5 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
Applied to u-boot-dm/next, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-27 1:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 16:26 [PATCH] dm: add cells_count parameter in live DT APIs of_parse_phandle_with_args Patrick Delaunay
2020-09-17 1:09 ` Simon Glass
2020-09-27 1:59 ` Simon Glass
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.