All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Marek Vasut <marex@denx.de>, <dri-devel@lists.freedesktop.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Jonas Karlman <jonas@kwiboo.se>,
	robert.foss@linaro.org, Maxime Ripard <maxime@cerno.tech>,
	Sam Ravnborg <sam@ravnborg.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH] drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid
Date: Thu, 19 May 2022 09:43:36 +0200	[thread overview]
Message-ID: <e4eeb60e-c694-cdf1-7ef8-e6180de20b1b@intel.com> (raw)
In-Reply-To: <20220518233844.248504-1-marex@denx.de>

On 19.05.2022 01:38, Marek Vasut wrote:
> Handle empty data-lanes = < >; property, which translates to
> dsi_lanes = 0 as invalid.
> 
> Fixes: ceb515ba29ba6 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Maxime Ripard <maxime@cerno.tech>
> Cc: Neil Armstrong <narmstrong@baylibre.com>
> Cc: Robert Foss <robert.foss@linaro.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>

I wonder if you could not make common helper to get number of lanes with 
checks included, quite trivial, but maybe worth to standardize it.

Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej
> ---
>   drivers/gpu/drm/bridge/ti-sn65dsi83.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ti-sn65dsi83.c b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> index d64d4385188dd..dc65f424e7f3c 100644
> --- a/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> +++ b/drivers/gpu/drm/bridge/ti-sn65dsi83.c
> @@ -585,7 +585,7 @@ static int sn65dsi83_parse_dt(struct sn65dsi83 *ctx, enum sn65dsi83_model model)
>   	ctx->host_node = of_graph_get_remote_port_parent(endpoint);
>   	of_node_put(endpoint);
>   
> -	if (ctx->dsi_lanes < 0 || ctx->dsi_lanes > 4) {
> +	if (ctx->dsi_lanes <= 0 || ctx->dsi_lanes > 4) {
>   		ret = -EINVAL;
>   		goto err_put_node;
>   	}


  reply	other threads:[~2022-05-19  7:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 23:38 [PATCH] drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid Marek Vasut
2022-05-19  7:43 ` Andrzej Hajda [this message]
2022-05-19  7:57 ` Lucas Stach
2022-05-23  9:40   ` Robert Foss
2022-05-23  9:58     ` Marek Vasut
2022-05-23 10:23       ` Robert Foss
2022-05-23 10:54         ` Marek Vasut

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=e4eeb60e-c694-cdf1-7ef8-e6180de20b1b@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonas@kwiboo.se \
    --cc=marex@denx.de \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=robert.foss@linaro.org \
    --cc=sam@ravnborg.org \
    /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.