<html><body><p>
<pre>
Hi, Angelo:

On Thu, 2024-12-05 at 12:45 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
>
>
> In preparation for adding a new driver for the HDMI TX v2 IP,
> split out the functions that will be common between the already
> present mtk_hdmi (v1) driver and the new one.
>
> Since the probe flow for both drivers is 90% similar, add a common
> probe function that will be called from each driver's .probe()
> callback, avoiding lots of code duplication.
>
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> ---

[snip]

> static void mtk_hdmi_clk_disable_audio(struct mtk_hdmi *hdmi)
> @@ -1143,10 +886,11 @@ static void mtk_hdmi_clk_disable_audio(struct mtk_hdmi *hdmi)
> static enum drm_connector_status
> mtk_hdmi_update_plugged_status(struct mtk_hdmi *hdmi)
> {
> - bool connected;
> + bool connected = true;
>
> mutex_lock(&hdmi->update_plugged_status_lock);
> - connected = mtk_cec_hpd_high(hdmi->cec_dev);
> + if (hdmi->cec_dev)

Only v1 would call mtk_hdmi_update_plugged_status() and v1 should has hdmi->cec_dev,
so this checking is redundant.

> + connected = mtk_cec_hpd_high(hdmi->cec_dev);
> if (hdmi->plugged_cb && hdmi->codec_dev)
> hdmi->plugged_cb(hdmi->codec_dev, connected);
> mutex_unlock(&hdmi->update_plugged_status_lock);
> @@ -1254,18 +998,12 @@ static int mtk_hdmi_bridge_attach(struct drm_bridge *bridge,
> return ret;
> }
>
> - mtk_cec_set_hpd_event(hdmi->cec_dev, mtk_hdmi_hpd_event, hdmi->dev);
> + if (hdmi->cec_dev)

Ditto.

Regards,
CK

> + mtk_cec_set_hpd_event(hdmi->cec_dev, mtk_hdmi_hpd_event, hdmi->dev);
>
> return 0;
> }
>


</pre>
</p></body></html><!--type:text--><!--{--><pre>************* MEDIATEK Confidentiality Notice
 ********************
The information contained in this e-mail message (including any 
attachments) may be confidential, proprietary, privileged, or otherwise
exempt from disclosure under applicable laws. It is intended to be 
conveyed only to the designated recipient(s). Any use, dissemination, 
distribution, printing, retaining or copying of this e-mail (including its 
attachments) by unintended recipient(s) is strictly prohibited and may 
be unlawful. If you are not an intended recipient of this e-mail, or believe
 
that you have received this e-mail in error, please notify the sender 
immediately (by replying to this e-mail), delete any and all copies of 
this e-mail (including any attachments) from your system, and do not
disclose the content of this e-mail to any other person. Thank you!
</pre><!--}-->