drm/tilcdc: Fix bad if statement in tilcdc_get_external_components()
Subsystems (3)
PATCH 1/1 drm/tilcdc: Fix bad if statement in tilcdc_get_external_components()
The if statement condition should have been "!node || !of_device_is_available(node)" (&& changed to ||), but let's rewrite the whole inside of the loop for better readability.
Reported-by Dan Carpenter <[email protected]>
Signed-off-by Jyri Sarha <[email protected]>
--- drivers/gpu/drm/tilcdc/tilcdc_external.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-)
drivers/gpu/drm/tilcdc/tilcdc_external.c +8 -11
@@ -142,19 +142,16 @@ int tilcdc_get_external_components(struct device *dev,int count =0 ;while ((ep =of_graph_get_next_endpoint (dev->of_node, ep))) { -struct device_node *node; - - node =of_graph_get_remote_port_parent (ep); -if (!node && !of_device_is_available (node)) { -of_node_put (node); -continue ; +struct device_node *node =of_graph_get_remote_port_parent (ep); + +if (node &&of_device_is_available (node)) { +dev_dbg (dev,"Subdevice node '%s' found\n" , node->name); +if (match) +component_match_add (dev, match, dev_match_of, + node); + count++; } - -dev_dbg (dev,"Subdevice node '%s' found\n" , node->name); -if (match) -component_match_add (dev, match, dev_match_of, node);of_node_put (node); - count++; }if (count >1 ) {
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel