lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cbbdc53ea47f0e7ea02fc7d197664819958ea2cd.camel@mediatek.com>
Date: Fri, 24 Jan 2025 08:24:54 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	"chunkuang.hu@...nel.org" <chunkuang.hu@...nel.org>
CC: "robh@...nel.org" <robh@...nel.org>, "jie.qiu@...iatek.com"
	<jie.qiu@...iatek.com>, "tzimmermann@...e.de" <tzimmermann@...e.de>,
	"simona@...ll.ch" <simona@...ll.ch>, "mripard@...nel.org"
	<mripard@...nel.org>, Jitao Shi (石记涛)
	<jitao.shi@...iatek.com>, "linux-mediatek@...ts.infradead.org"
	<linux-mediatek@...ts.infradead.org>, "dri-devel@...ts.freedesktop.org"
	<dri-devel@...ts.freedesktop.org>, "maarten.lankhorst@...ux.intel.com"
	<maarten.lankhorst@...ux.intel.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "devicetree@...r.kernel.org"
	<devicetree@...r.kernel.org>, "kernel@...labora.com" <kernel@...labora.com>,
	"dmitry.baryshkov@...aro.org" <dmitry.baryshkov@...aro.org>,
	"krzk+dt@...nel.org" <krzk+dt@...nel.org>,
	Lewis Liao (廖柏鈞) <Lewis.Liao@...iatek.com>,
	"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>, "conor+dt@...nel.org"
	<conor+dt@...nel.org>, TommyYL Chen (陳彥良)
	<TommyYL.Chen@...iatek.com>, Ives Chenjh (陳俊弘)
	<Ives.Chenjh@...iatek.com>, "airlied@...il.com" <airlied@...il.com>,
	"linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "matthias.bgg@...il.com"
	<matthias.bgg@...il.com>, Jason-JH Lin (林睿祥)
	<Jason-JH.Lin@...iatek.com>, "junzhi.zhao@...iatek.com"
	<junzhi.zhao@...iatek.com>
Subject: Re: [PATCH v5 20/34] drm/mediatek: mtk_hdmi: Use dev_err_probe() in
 mtk_hdmi_dt_parse_pdata()

Hi, Angelo:

On Mon, 2025-01-13 at 15:52 +0100, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> Change error prints to use dev_err_probe() instead of dev_err()
> where possible in function mtk_hdmi_dt_parse_pdata(), used only
> during device probe.
> While at it, also beautify some prints.

I think you have do two things.
The first one is "Use dev_err_probe() in mtk_hdmi_dt_parse_pdata()" as the title says.
The second one is "beautify some prints".

The title does not mention the second one, so I think the second one is not related to this patch.
You think some refinement is not worth to be a patch.
If it's not worth, maybe we should keep them as they are.
Or you could collect all refinement into one refinement patch, and this would looks worth.

Regards,
CK

> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 34 ++++++++++-------------------
>  1 file changed, 11 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index 65e9629b6b77..48c37294dcbb 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1372,30 +1372,23 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
>  {
>         struct device *dev = &pdev->dev;
>         struct device_node *np = dev->of_node;
> -       struct device_node *cec_np, *remote, *i2c_np;
> +       struct device_node *remote, *i2c_np;
>         struct platform_device *cec_pdev;
>         struct regmap *regmap;
>         int ret;
> 
>         ret = mtk_hdmi_get_all_clk(hdmi, np);
> -       if (ret) {
> -               if (ret != -EPROBE_DEFER)
> -                       dev_err(dev, "Failed to get clocks: %d\n", ret);
> -
> -               return ret;
> -       }
> +       if (ret)
> +               return dev_err_probe(dev, ret, "Failed to get clocks\n");
> 
>         /* The CEC module handles HDMI hotplug detection */
>         cec_np = of_get_compatible_child(np->parent, "mediatek,mt8173-cec");
> -       if (!cec_np) {
> -               dev_err(dev, "Failed to find CEC node\n");
> -               return -EINVAL;
> -       }
> +       if (!cec_np)
> +               return dev_err_probe(dev, -EINVAL, "Failed to find CEC node\n");
> 
>         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;
>         }
> @@ -1413,9 +1406,8 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
>         if (IS_ERR(regmap))
>                 ret = PTR_ERR(regmap);
>         if (ret) {
> -               dev_err(dev,
> -                       "Failed to get system configuration registers: %d\n",
> -                       ret);
> +               dev_err_probe(dev, ret,
> +                             "Failed to get system configuration registers\n");
>                 goto put_device;
>         }
>         hdmi->sys_regmap = regmap;
> @@ -1443,20 +1435,16 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
>         }
> 
>         i2c_np = of_parse_phandle(remote, "ddc-i2c-bus", 0);
> +       of_node_put(remote);
>         if (!i2c_np) {
> -               dev_err(dev, "Failed to find ddc-i2c-bus node in %pOF\n",
> -                       remote);
> -               of_node_put(remote);
> -               ret = -EINVAL;
> +               ret = dev_err_probe(dev, -EINVAL, "No ddc-i2c-bus in connector\n");
>                 goto put_device;
>         }
> -       of_node_put(remote);
> 
>         hdmi->ddc_adpt = of_find_i2c_adapter_by_node(i2c_np);
>         of_node_put(i2c_np);
>         if (!hdmi->ddc_adpt) {
> -               dev_err(dev, "Failed to get ddc i2c adapter by node\n");
> -               ret = -EINVAL;
> +               ret = dev_err_probe(dev, -EINVAL, "Failed to get ddc i2c adapter by node\n");
>                 goto put_device;
>         }
> 
> --
> 2.47.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ