From: Marek Vasut Date: Thu, 19 May 2022 09:51:36 +0000 (+0200) Subject: drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid X-Git-Tag: v6.1-rc5~617^2~23^2~70 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d662350928e6787d29ab205e47e5aa6f1f792f9;p=platform%2Fkernel%2Flinux-starfive.git drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid. Reviewed-by: Andrzej Hajda Reviewed-by: Lucas Stach Fixes: bbfd3190b6562 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") Signed-off-by: Marek Vasut Cc: Jonas Karlman Cc: Laurent Pinchart Cc: Lucas Stach Cc: Marek Vasut Cc: Maxime Ripard Cc: Neil Armstrong Cc: Robert Foss Cc: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220519095137.11896-1-marex@denx.de --- diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 798da0e..f78c2ad 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1899,7 +1899,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) of_node_put(host_node); of_node_put(endpoint); - if (dsi_lanes < 0 || dsi_lanes > 4) + if (dsi_lanes <= 0 || dsi_lanes > 4) return -EINVAL; if (!host)