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 <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Robert Foss <[email protected]>
Cc: Sam Ravnborg <[email protected]>

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 <[email protected]>

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 via email to