From: Andrzej Hajda <a.hajda@samsung.com>
To: Philipp Zabel <p.zabel@pengutronix.de>, dri-devel@lists.freedesktop.org
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
kernel@pengutronix.de, Hyungwon Hwang <human.hwang@samsung.com>
Subject: Re: [PATCH 1/2] drm/exynos/dpi: use of_graph_get_endpoint_by_regs helper
Date: Wed, 04 May 2016 08:20:21 +0200 [thread overview]
Message-ID: <572994A5.5000408@samsung.com> (raw)
In-Reply-To: <1462283245-10586-1-git-send-email-p.zabel@pengutronix.de>
On 05/03/2016 03:47 PM, Philipp Zabel wrote:
> This allows to remove the local of_graph_get_port_by_reg(),
> of_graph_get_endpoint_by_reg(), of_get_child_by_name_reg(),
> and of_graph_get_remote_port_parent() functions.
>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Thanks for the patch.
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
--
Regards
Andrzej
> ---
> drivers/gpu/drm/exynos/exynos_drm_dpi.c | 69 +--------------------------------
> 1 file changed, 2 insertions(+), 67 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> index 75e570f..5e38e74 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c
> @@ -15,6 +15,7 @@
> #include <drm/drm_panel.h>
> #include <drm/drm_atomic_helper.h>
>
> +#include <linux/of_graph.h>
> #include <linux/regulator/consumer.h>
>
> #include <video/of_videomode.h>
> @@ -164,67 +165,6 @@ static const struct drm_encoder_funcs exynos_dpi_encoder_funcs = {
> .destroy = drm_encoder_cleanup,
> };
>
> -/* of_* functions will be removed after merge of of_graph patches */
> -static struct device_node *
> -of_get_child_by_name_reg(struct device_node *parent, const char *name, u32 reg)
> -{
> - struct device_node *np;
> -
> - for_each_child_of_node(parent, np) {
> - u32 r;
> -
> - if (!np->name || of_node_cmp(np->name, name))
> - continue;
> -
> - if (of_property_read_u32(np, "reg", &r) < 0)
> - r = 0;
> -
> - if (reg == r)
> - break;
> - }
> -
> - return np;
> -}
> -
> -static struct device_node *of_graph_get_port_by_reg(struct device_node *parent,
> - u32 reg)
> -{
> - struct device_node *ports, *port;
> -
> - ports = of_get_child_by_name(parent, "ports");
> - if (ports)
> - parent = ports;
> -
> - port = of_get_child_by_name_reg(parent, "port", reg);
> -
> - of_node_put(ports);
> -
> - return port;
> -}
> -
> -static struct device_node *
> -of_graph_get_endpoint_by_reg(struct device_node *port, u32 reg)
> -{
> - return of_get_child_by_name_reg(port, "endpoint", reg);
> -}
> -
> -static struct device_node *
> -of_graph_get_remote_port_parent(const struct device_node *node)
> -{
> - struct device_node *np;
> - unsigned int depth;
> -
> - np = of_parse_phandle(node, "remote-endpoint", 0);
> -
> - /* Walk 3 levels up only if there is 'ports' node. */
> - for (depth = 3; depth && np; depth--) {
> - np = of_get_next_parent(np);
> - if (depth == 2 && of_node_cmp(np->name, "ports"))
> - break;
> - }
> - return np;
> -}
> -
> enum {
> FIMD_PORT_IN0,
> FIMD_PORT_IN1,
> @@ -237,12 +177,7 @@ static struct device_node *exynos_dpi_of_find_panel_node(struct device *dev)
> {
> struct device_node *np, *ep;
>
> - np = of_graph_get_port_by_reg(dev->of_node, FIMD_PORT_RGB);
> - if (!np)
> - return NULL;
> -
> - ep = of_graph_get_endpoint_by_reg(np, 0);
> - of_node_put(np);
> + ep = of_graph_get_endpoint_by_regs(dev->of_node, FIMD_PORT_RGB, 0);
> if (!ep)
> return NULL;
>
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2016-05-04 6:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 13:47 [PATCH 1/2] drm/exynos/dpi: use of_graph_get_endpoint_by_regs helper Philipp Zabel
2016-05-03 13:47 ` [PATCH 2/2] drm/exynos/dsi: " Philipp Zabel
2016-05-04 6:20 ` Andrzej Hajda
2016-05-04 6:20 ` Andrzej Hajda [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=572994A5.5000408@samsung.com \
--to=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=human.hwang@samsung.com \
--cc=kernel@pengutronix.de \
--cc=kyungmin.park@samsung.com \
--cc=p.zabel@pengutronix.de \
--cc=sw0312.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.