Re: [PATCH] drm: of: simplify component probe code
On Tuesday 06 March 2018 01:46 PM, Philipp Zabel wrote: On Thu, 2018-02-22 at 21:22 +0200, Baruch Siach wrote: Use positive logic for better readability. This also eliminates one of_node_put() call, making the code shorter. Signed-off-by: Baruch SiachReviewed-by: Philipp Zabel Tested-by: Philipp Zabel queued to drm-misc-next after fixing a minor checkpatch warning. Thanks, Archit regards Philipp --- 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, , compare_of, + port); - drm_of_component_match_add(dev, , compare_of, port); of_node_put(port); } ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm: of: simplify component probe code
On Thu, 2018-02-22 at 21:22 +0200, Baruch Siach wrote: > Use positive logic for better readability. This also eliminates one > of_node_put() call, making the code shorter. > > Signed-off-by: Baruch SiachReviewed-by: Philipp Zabel Tested-by: Philipp Zabel regards Philipp > --- > 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, , compare_of, > + port); > > - drm_of_component_match_add(dev, , compare_of, port); > of_node_put(port); > } > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH] drm: of: simplify component probe code
Use positive logic for better readability. This also eliminates one of_node_put() call, making the code shorter. Signed-off-by: Baruch Siach--- 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, , compare_of, + port); - drm_of_component_match_add(dev, , 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