[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4b15b282-7243-3f75-4a2e-ba86791f6431@denx.de>
Date: Wed, 5 Apr 2023 14:31:31 +0200
From: Marek Vasut <marex@...x.de>
To: Luca Ceresoli <luca.ceresoli@...tlin.com>
Cc: dri-devel@...ts.freedesktop.org,
Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>, linux-kernel@...r.kernel.org,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Paul Kocialkowski <paul.kocialkowski@...tlin.com>
Subject: Re: [PATCH] drm: bridge: ldb: add support for using channel 1 only
On 4/5/23 09:30, Luca Ceresoli wrote:
[...]
>>> @@ -311,10 +314,23 @@ static int fsl_ldb_probe(struct platform_device *pdev)
>>> if (IS_ERR(fsl_ldb->regmap))
>>> return PTR_ERR(fsl_ldb->regmap);
>>>
>>> - /* Locate the panel DT node. */
>>> - panel_node = of_graph_get_remote_node(dev->of_node, 1, 0);
>>> - if (!panel_node)
>>> - return -ENXIO;
>>> + /* Locate the remote ports and the panel node */
>>> + remote1 = of_graph_get_remote_node(dev->of_node, 1, 0);
>>> + remote2 = of_graph_get_remote_node(dev->of_node, 2, 0);
>>> + fsl_ldb->ch0_enabled = (remote1 != NULL);
>>> + fsl_ldb->ch1_enabled = (remote2 != NULL);
>>> + panel_node = of_node_get(remote1 ? remote1 : remote2);
>>
>> You can even do this without the middle 'remote1' I think:
>>
>> panel_node = of_node_get(remote1 ? : remote2);
>
> Apparently, but honestly with such short expressions clearly having no
> side effects I think it's not helping readability.
I think even the ternary operator itself isn't helpful much, but that's
a matter of taste, and I don't have a better suggestion which would
improve the readability either (I tried to expand it into if()... but
that looks bad too).
No need to change anything.
[...]
Thanks for the patch.
Powered by blists - more mailing lists