Message ID | 20220518233602.248185-1-marex@denx.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/3] drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid | expand |
On 19.05.2022 01:36, Marek Vasut wrote: > Handle empty data-lanes = < >; property, which translates to > dsi_lanes = 0 as invalid. > > Fixes: bbfd3190b6562 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") > 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> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Regards Andrzej > --- > drivers/gpu/drm/bridge/tc358767.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c > index 7366968dd7b21..84e6b5aa8dd1f 100644 > --- a/drivers/gpu/drm/bridge/tc358767.c > +++ b/drivers/gpu/drm/bridge/tc358767.c > @@ -1902,7 +1902,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)
Am Donnerstag, dem 19.05.2022 um 01:36 +0200 schrieb Marek Vasut: > Handle empty data-lanes = < >; property, which translates to > dsi_lanes = 0 as invalid. > I'm having a hard time imagining a situation where on would add a empty data-lanes property to the DT. But then 0 DSI lanes is clearly a broken configuration, so: Reviewed-by: Lucas Stach <l.stach@pengutronix.de> > Fixes: bbfd3190b6562 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") > 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> > --- > drivers/gpu/drm/bridge/tc358767.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c > index 7366968dd7b21..84e6b5aa8dd1f 100644 > --- a/drivers/gpu/drm/bridge/tc358767.c > +++ b/drivers/gpu/drm/bridge/tc358767.c > @@ -1902,7 +1902,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)
On 5/19/22 09:50, Lucas Stach wrote: > Am Donnerstag, dem 19.05.2022 um 01:36 +0200 schrieb Marek Vasut: >> Handle empty data-lanes = < >; property, which translates to >> dsi_lanes = 0 as invalid. >> > I'm having a hard time imagining a situation where on would add a empty > data-lanes property to the DT. Like when you make a typo for example .
diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 7366968dd7b21..84e6b5aa8dd1f 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1902,7 +1902,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)
Handle empty data-lanes = < >; property, which translates to dsi_lanes = 0 as invalid. Fixes: bbfd3190b6562 ("drm/bridge: tc358767: Add DSI-to-DPI mode support") 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> --- drivers/gpu/drm/bridge/tc358767.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)