* [PATCH 0/2] video: of: display_timing: fixes
@ 2013-09-25 11:51 Andrzej Hajda
2013-09-25 11:51 ` [PATCH 1/2] video: of: display_timing: correct display-timings node finding Andrzej Hajda
2013-09-25 11:51 ` [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist Andrzej Hajda
0 siblings, 2 replies; 5+ messages in thread
From: Andrzej Hajda @ 2013-09-25 11:51 UTC (permalink / raw)
To: open list:FRAMEBUFFER LAYER
Cc: Andrzej Hajda, Kyungmin Park, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard, dri-devel
Hi,
Those two independent patches fixes DT display_timings related code.
The first patch replaces of_find_node_by_name by of_get_child_by_name.
Usage of of_find_node_by_name in such context is incorrect:
- we need only direct child, and this function looks for following nodes
on implementation internal list regardless of the hierarchy,
- there is no warranty that child nodes are after parent nodes in
this search order, it happens to be true for DT created from FDT,
but it is not true for dynamic DT.
The second patch just removes unused/broken function.
Regards
Andrzej
Andrzej Hajda (2):
video: of: display_timing: correct display-timings node finding
video: of: display_timing: remove broken of_display_timings_exist
drivers/video/of_display_timing.c | 26 +++-----------------------
include/video/of_display_timing.h | 1 -
2 files changed, 3 insertions(+), 24 deletions(-)
--
1.8.1.2
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] video: of: display_timing: correct display-timings node finding
2013-09-25 11:51 [PATCH 0/2] video: of: display_timing: fixes Andrzej Hajda
@ 2013-09-25 11:51 ` Andrzej Hajda
2013-09-26 9:37 ` Tomi Valkeinen
2013-09-25 11:51 ` [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist Andrzej Hajda
1 sibling, 1 reply; 5+ messages in thread
From: Andrzej Hajda @ 2013-09-25 11:51 UTC (permalink / raw)
To: open list:FRAMEBUFFER LAYER
Cc: Andrzej Hajda, Kyungmin Park, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard, dri-devel
of_get_display_timing(s) use of_find_node_by_name
to get child node, this is incorrect, of_get_child_by_name
should be used instead. The patch fixes it.
Small typo is also corrected.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/of_display_timing.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 171821d..ba5b40f 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -120,7 +120,7 @@ int of_get_display_timing(struct device_node *np, const char *name,
return -EINVAL;
}
- timing_np = of_find_node_by_name(np, name);
+ timing_np = of_get_child_by_name(np, name);
if (!timing_np) {
pr_err("%s: could not find node '%s'\n",
of_node_full_name(np), name);
@@ -143,11 +143,11 @@ struct display_timings *of_get_display_timings(struct device_node *np)
struct display_timings *disp;
if (!np) {
- pr_err("%s: no devicenode given\n", of_node_full_name(np));
+ pr_err("%s: no device node given\n", of_node_full_name(np));
return NULL;
}
- timings_np = of_find_node_by_name(np, "display-timings");
+ timings_np = of_get_child_by_name(np, "display-timings");
if (!timings_np) {
pr_err("%s: could not find display-timings node\n",
of_node_full_name(np));
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist
2013-09-25 11:51 [PATCH 0/2] video: of: display_timing: fixes Andrzej Hajda
2013-09-25 11:51 ` [PATCH 1/2] video: of: display_timing: correct display-timings node finding Andrzej Hajda
@ 2013-09-25 11:51 ` Andrzej Hajda
2013-09-26 9:37 ` Tomi Valkeinen
1 sibling, 1 reply; 5+ messages in thread
From: Andrzej Hajda @ 2013-09-25 11:51 UTC (permalink / raw)
To: open list:FRAMEBUFFER LAYER
Cc: Andrzej Hajda, Kyungmin Park, Tomi Valkeinen,
Jean-Christophe Plagniol-Villard, dri-devel
of_display_timings_exist is implemented incorrectly.
It tries to find property instead of node.
The function is not used anyway so the patch removes it.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
drivers/video/of_display_timing.c | 20 --------------------
include/video/of_display_timing.h | 1 -
2 files changed, 21 deletions(-)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index ba5b40f..b423bb9 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -247,23 +247,3 @@ dispfail:
return NULL;
}
EXPORT_SYMBOL_GPL(of_get_display_timings);
-
-/**
- * of_display_timings_exist - check if a display-timings node is provided
- * @np: device_node with the timing
- **/
-int of_display_timings_exist(struct device_node *np)
-{
- struct device_node *timings_np;
-
- if (!np)
- return -EINVAL;
-
- timings_np = of_parse_phandle(np, "display-timings", 0);
- if (!timings_np)
- return -EINVAL;
-
- of_node_put(timings_np);
- return 1;
-}
-EXPORT_SYMBOL_GPL(of_display_timings_exist);
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h
index 79e6697..16cde75 100644
--- a/include/video/of_display_timing.h
+++ b/include/video/of_display_timing.h
@@ -18,6 +18,5 @@ struct display_timings;
int of_get_display_timing(struct device_node *np, const char *name,
struct display_timing *dt);
struct display_timings *of_get_display_timings(struct device_node *np);
-int of_display_timings_exist(struct device_node *np);
#endif
--
1.8.1.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist
2013-09-25 11:51 ` [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist Andrzej Hajda
@ 2013-09-26 9:37 ` Tomi Valkeinen
0 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2013-09-26 9:37 UTC (permalink / raw)
To: Andrzej Hajda
Cc: FRAMEBUFFER LAYER, Jean-Christophe Plagniol-Villard,
Kyungmin Park, dri-devel
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
On 25/09/13 14:51, Andrzej Hajda wrote:
> of_display_timings_exist is implemented incorrectly.
> It tries to find property instead of node.
> The function is not used anyway so the patch removes it.
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/video/of_display_timing.c | 20 --------------------
> include/video/of_display_timing.h | 1 -
> 2 files changed, 21 deletions(-)
Fix by removal? =).
Wouldn't it be better to fix the function? It's not used currently, but
the whole display-timings stuff is still quite new. One could use
of_get_display_timings() to check for the existence of timings, but that
function will print an error if no timings are found.
Then again, what would be the case where you want to check if the
timings exist... I'd presume that there either has to be timings or
there are no timings.
So, I don't know. Any else has opinions whether to remove or fix the
function?
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] video: of: display_timing: correct display-timings node finding
2013-09-25 11:51 ` [PATCH 1/2] video: of: display_timing: correct display-timings node finding Andrzej Hajda
@ 2013-09-26 9:37 ` Tomi Valkeinen
0 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2013-09-26 9:37 UTC (permalink / raw)
To: Andrzej Hajda, FRAMEBUFFER LAYER
Cc: Kyungmin Park, Jean-Christophe Plagniol-Villard, dri-devel
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
On 25/09/13 14:51, Andrzej Hajda wrote:
> of_get_display_timing(s) use of_find_node_by_name
> to get child node, this is incorrect, of_get_child_by_name
> should be used instead. The patch fixes it.
> Small typo is also corrected.
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/video/of_display_timing.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Thanks, queuing for 3.12 fixes.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-09-26 9:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-25 11:51 [PATCH 0/2] video: of: display_timing: fixes Andrzej Hajda
2013-09-25 11:51 ` [PATCH 1/2] video: of: display_timing: correct display-timings node finding Andrzej Hajda
2013-09-26 9:37 ` Tomi Valkeinen
2013-09-25 11:51 ` [PATCH 2/2] video: of: display_timing: remove broken of_display_timings_exist Andrzej Hajda
2013-09-26 9:37 ` Tomi Valkeinen
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).