Re: [PATCH 2/8] drm/mxsfb/lcdif: don't unnecessarily loop over ports

Liu Ying
2026-03-26T06:58:49Z

Hi Luca,

On Fri, Mar 20, 2026 at 11:46:13AM +0100, Luca Ceresoli wrote:
> According to the bindings [0] there can be only one port. The in-tree board
> device trees also don't contain multiple ports (searched thos matching

s/thos/those/

> 'fsl,imx(23|28|6sx|8mp|93)-lcdif').
>
> Avoid an unnecessary loop around multipltle ports. This allows to greatly

s/multipltle/multiple/

> simplify the code.
>
> [0] Documentation/devicetree/bindings/display/fsl,lcdif.yaml
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Viewing this patch with '--ignore-all-space' is recommended
> ---
> drivers/gpu/drm/mxsfb/lcdif_drv.c | 77 ++++++++++++++-------------------------
> 1 file changed, 27 insertions(+), 50 deletions(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> index 756ca96373c8..83e134c04882 100644
> --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
> +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> @@ -48,61 +48,38 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs = {
> static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> {
> struct device *dev = lcdif->drm->dev;
> - struct device_node *ep;
> + struct drm_encoder *encoder;
> struct drm_bridge *bridge;
> int ret;
>
> - for_each_endpoint_of_node(dev->of_node, ep) {

The single i.MX93 LCDIF may connect with a DPI/LVDS/MIPI DSI encoder.
Each encoder maps to an endpoint in a port, hence 3 endpoints in all.
See lcdif node in imx91_93_common.dtsi and imx93.dtsi in linux-next/master.

--
Regards,
Liu Ying