dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: of: simplify component probe code
@ 2018-02-22 19:22 Baruch Siach
  2018-03-06  8:16 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Baruch Siach @ 2018-02-22 19:22 UTC (permalink / raw)
  To: Daniel Vetter, Jani Nikula, Sean Paul, David Airlie
  Cc: Baruch Siach, dri-devel

Use positive logic for better readability. This also eliminates one
of_node_put() call, making the code shorter.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 drivers/gpu/drm/drm_of.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 4c191c050e7d..fa354d14127b 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -122,12 +122,10 @@ int drm_of_component_probe(struct device *dev,
 		if (!port)
 			break;
 
-		if (!of_device_is_available(port->parent)) {
-			of_node_put(port);
-			continue;
-		}
+		if (of_device_is_available(port->parent))
+			drm_of_component_match_add(dev, &match, compare_of,
+				port);
 
-		drm_of_component_match_add(dev, &match, compare_of, port);
 		of_node_put(port);
 	}
 
-- 
2.16.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2018-03-06  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 19:22 [PATCH] drm: of: simplify component probe code Baruch Siach
2018-03-06  8:16 ` Philipp Zabel
2018-03-06  8:52   ` Archit Taneja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox