[2/2] OMAPDSS: of-dss: omap_dss_find_output_by_port_node() keep port refcount
diff mbox

Message ID 1f1f0438904af54bcaadd6e1796dad06e7001172.1438885638.git.jsarha@ti.com
State New
Headers show

Commit Message

Jyri Sarha Aug. 6, 2015, 6:41 p.m. UTC
The only user of dss_of_port_get_parent_device() function is
omap_dss_find_output_by_port_node() and it assumes the refcount of the
port parameter is not decremented by the call.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/dss-of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tomi Valkeinen Aug. 7, 2015, 10:49 a.m. UTC | #1
Hi,

On 06/08/15 21:41, Jyri Sarha wrote:
> The only user of dss_of_port_get_parent_device() function is
> omap_dss_find_output_by_port_node() and it assumes the refcount of the
> port parameter is not decremented by the call.
> 

The subject of the patch should contain "dss-of", not "of-dss". Although
for both patches I think it's fine to use plain "OMAPDSS: " prefix. The
subject should also say "fix" or such.

The description above is kind of "detached". A patch description should
generally describe something in the lines of what the current behavior
is, what the problem is, and what the patch does. And the desc should be
independent of the subject.

This particular case is rather simple, and it's clear that
dss_of_port_get_parent_device() is not supposed to decrease the refcount
of the "port" parameter (as that kind of behavior is normally a special
case). And so it should be enough to say what the issue seen is and that
you fix the function to not decrement the parameter's refcount.

 Tomi

Patch
diff mbox

diff --git a/drivers/video/fbdev/omap2/dss/dss-of.c b/drivers/video/fbdev/omap2/dss/dss-of.c
index ab6ef16..43f999d 100644
--- a/drivers/video/fbdev/omap2/dss/dss-of.c
+++ b/drivers/video/fbdev/omap2/dss/dss-of.c
@@ -95,7 +95,7 @@  struct device_node *dss_of_port_get_parent_device(struct device_node *port)
 	if (!port)
 		return NULL;
 
-	np = of_get_next_parent(port);
+	np = of_get_parent(port);
 
 	for (i = 0; i < 2 && np; ++i) {
 		struct property *prop;