From: Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
David Airlie <airlied@gmail.com>,
Simona Vetter <simona@ffwll.ch>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
CK Hu <ck.hu@mediatek.com>,
kernel@collabora.com, dri-devel@lists.freedesktop.org,
linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v11 05/11] drm/mediatek: mtk_hdmi_common: Make CEC support optional
Date: Thu, 23 Oct 2025 19:05:31 +0200 [thread overview]
Message-ID: <a55c9480da785a8618dd60c3f3e0ddc398c5d45f.camel@collabora.com> (raw)
In-Reply-To: <CAAOTY_8y6C5=jSjzBVVJ2vJq1L+Nf9U0tZvxzVX-e-3g91xEeQ@mail.gmail.com>
Hi,
On Thu, 2025-10-23 at 15:59 +0000, Chun-Kuang Hu wrote:
> Hi, Louis:
>
> Louis-Alexis Eyraud <louisalexis.eyraud@collabora.com> 於 2025年10月23日
> 週四 上午10:32寫道:
> >
> > From: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com>
> >
> > In preparation for adding a new driver for HDMIv2, for which CEC
> > is not strictly required, change the of_get_compatible_child()
> > failure error to -ENOTSUPP to be able to differentiate between
> > error conditions in mtk_hdmi_dt_parse_pdata().
> >
> > In that case, if -ENOTSUPP is returned, this driver will print
> > an informative message saying that CEC support is unavailable,
> > as the devicetree node for that was not found, but after that,
> > function mtk_hdmi_dt_parse_pdata() will not return error to
> > the caller.
> >
> > This will not change functionality of the mtk_hdmi (v1) driver
> > as that is still checking whether CEC is present and, if not,
> > will fail probing with an error saying that CEC is required
> > by HDMIv1.
> >
> > Reviewed-by: CK Hu <ck.hu@mediatek.com>
> > Signed-off-by: AngeloGioacchino Del Regno
> > <angelogioacchino.delregno@collabora.com>
> > Signed-off-by: Louis-Alexis Eyraud
> > <louisalexis.eyraud@collabora.com>
> > ---
> > drivers/gpu/drm/mediatek/mtk_hdmi_common.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c
> > b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c
> > index
> > f28e63716d7c2e2c6bdf5b28d24789bc926d2beb..989479fdfe40952762a1b6379
> > 7bf602b520dcac5 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_hdmi_common.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_hdmi_common.c
> > @@ -253,12 +253,11 @@ static int mtk_hdmi_get_cec_dev(struct
> > mtk_hdmi *hdmi, struct device *dev, struc
> > /* The CEC module handles HDMI hotplug detection */
> > cec_np = of_get_compatible_child(np->parent,
> > "mediatek,mt8173-cec");
> > if (!cec_np)
> > - return dev_err_probe(dev, -EINVAL, "Failed to find
> > CEC node\n");
> > + return dev_err_probe(dev, -ENOTSUPP, "Failed to
> > find CEC node\n");
>
> The checkpatch show the warning:
>
> WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
> #40: FILE: drivers/gpu/drm/mediatek/mtk_hdmi_common.c:256:
> + return dev_err_probe(dev, -ENOTSUPP, "Failed to find CEC
> node\n");
>
> I find many driver use ENOTSUPP, so I'm not sure which one is better.
> I really don't understand the description about these two error code
> [1].
> If you choose ENOTSUPP, please give me some explain.
>
> [1] https://man7.org/linux/man-pages/man3/errno.3.html
>
> Regards,
> Chun-Kuang.
>
>
I think ENOTSUPP can be replaced by EOPNOTSUPP in this patch safely.
There is only a single call of the mtk_hdmi_get_cec_dev function in the
driver and the code that checks this particular return code value in
mtk_hdmi_dt_parse_pdata function is also added by this patch.
I also don't see no other occurrence of ENOTSUPP code in mediatek-drm
and since checkpatch recommends to prefer EOPNOTSUPP over ENOTSUPP,
let's replace it in this patch (both code and commit message).
Do you want me to send a new version of the series for this change?
Regards,
Louis-Alexis
> > cec_pdev = of_find_device_by_node(cec_np);
> > if (!cec_pdev) {
> > - dev_err(hdmi->dev, "Waiting for CEC device %pOF\n",
> > - cec_np);
> > + dev_err(hdmi->dev, "Waiting for CEC device %pOF\n",
> > cec_np);
> > of_node_put(cec_np);
> > return -EPROBE_DEFER;
> > }
> > @@ -319,7 +318,9 @@ static int mtk_hdmi_dt_parse_pdata(struct
> > mtk_hdmi *hdmi, struct platform_device
> > return dev_err_probe(dev, -EINVAL, "Failed to get
> > ddc i2c adapter by node\n");
> >
> > ret = mtk_hdmi_get_cec_dev(hdmi, dev, np);
> > - if (ret)
> > + if (ret == -ENOTSUPP)
> > + dev_info(dev, "CEC support unavailable: node not
> > found\n");
> > + else if (ret)
> > return ret;
> >
> > return 0;
> >
> > --
> > 2.51.0
> >
next prev parent reply other threads:[~2025-10-23 17:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-23 10:32 [PATCH v11 00/11] Add support for MT8195/88 HDMIv2 and DDCv2 Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 01/11] drm/mediatek: mtk_hdmi: Drop redundant clock retrieval in mtk_hdmi_get_cec_dev Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 02/11] drm/mediatek: mtk_hdmi: Improve mtk_hdmi_get_all_clk() flexibility Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 03/11] drm/mediatek: mtk_hdmi: Add HDMI IP version configuration to pdata Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 04/11] drm/mediatek: mtk_hdmi: Split driver and add common probe function Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 05/11] drm/mediatek: mtk_hdmi_common: Make CEC support optional Louis-Alexis Eyraud
2025-10-23 15:59 ` Chun-Kuang Hu
2025-10-23 17:05 ` Louis-Alexis Eyraud [this message]
2025-10-24 0:35 ` Chun-Kuang Hu
2025-10-23 10:32 ` [PATCH v11 06/11] drm/mediatek: mtk_hdmi_common: Assign DDC adapter pointer to bridge Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 07/11] drm/mediatek: mtk_hdmi_common: Add OP_HDMI if helper funcs assigned Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 08/11] drm/mediatek: mtk_hdmi_common: Add var to enable interlaced modes Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 09/11] drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188 Louis-Alexis Eyraud
2025-10-24 1:05 ` Chun-Kuang Hu
2025-10-24 7:38 ` AngeloGioacchino Del Regno
2025-10-23 10:32 ` [PATCH v11 10/11] drm/mediatek: mtk_hdmi_v2: Add debugfs ops and implement ABIST Louis-Alexis Eyraud
2025-10-23 10:32 ` [PATCH v11 11/11] drm/mediatek: mtk_hdmi_common: Defer probe when ddc i2c bus isn't available yet Louis-Alexis Eyraud
2025-10-24 12:39 ` [PATCH v11 00/11] Add support for MT8195/88 HDMIv2 and DDCv2 Chun-Kuang Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a55c9480da785a8618dd60c3f3e0ddc398c5d45f.camel@collabora.com \
--to=louisalexis.eyraud@collabora.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=chunkuang.hu@kernel.org \
--cc=ck.hu@mediatek.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=simona@ffwll.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox