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: <bb903722cf60d6efdfdc64598faf21e45f72e128.camel@mediatek.com>
Date: Thu, 13 Feb 2025 06:39:28 +0000
From: CK Hu (胡俊光) <ck.hu@...iatek.com>
To: "krzysztof.kozlowski@...aro.org" <krzysztof.kozlowski@...aro.org>,
	"simona@...ll.ch" <simona@...ll.ch>, "dri-devel@...ts.freedesktop.org"
	<dri-devel@...ts.freedesktop.org>, AngeloGioacchino Del Regno
	<angelogioacchino.delregno@...labora.com>, "airlied@...il.com"
	<airlied@...il.com>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "chunkuang.hu@...nel.org"
	<chunkuang.hu@...nel.org>, "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
	"matthias.bgg@...il.com" <matthias.bgg@...il.com>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 1/2] drm/mediatek/hdmi: Use
 syscon_regmap_lookup_by_phandle_args

On Sun, 2025-01-12 at 14:47 +0100, Krzysztof Kozlowski wrote:
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> 
> 
> Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over
> syscon_regmap_lookup_by_phandle() combined with getting the syscon
> argument.  Except simpler code this annotates within one line that given
> phandle has arguments, so grepping for code would be easier.
> 
> There is also no real benefit in printing errors on missing syscon
> argument, because this is done just too late: runtime check on
> static/build-time data.  Dtschema and Devicetree bindings offer the
> static/build-time check for this already.

Reviewed-by: CK Hu <ck.hu@...iatek.com>

I've not decided to apply this patch first or Angelo's patch first.
I'll fix conflict when I apply both patch.

Regards,
CK

> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> ---
>  drivers/gpu/drm/mediatek/mtk_hdmi.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index ca82bc829cb9..4b0eb7dc25d8 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1458,15 +1458,11 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi,
>          * MMSYS_CONFIG device and the register offset of the HDMI_SYS_CFG
>          * registers it contains.
>          */
> -       regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,syscon-hdmi");
> -       ret = of_property_read_u32_index(np, "mediatek,syscon-hdmi", 1,
> -                                        &hdmi->sys_offset);
> -       if (IS_ERR(regmap))
> -               ret = PTR_ERR(regmap);
> -       if (ret) {
> -               dev_err(dev,
> -                       "Failed to get system configuration registers: %d\n",
> -                       ret);
> +       regmap = syscon_regmap_lookup_by_phandle_args(np, "mediatek,syscon-hdmi",
> +                                                     1, &hdmi->sys_offset);
> +       if (IS_ERR(regmap)) {
> +               ret = dev_err_probe(dev, PTR_ERR(regmap),
> +                                   "Failed to get system configuration registers\n");
>                 goto put_device;
>         }
>         hdmi->sys_regmap = regmap;
> --
> 2.43.0
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ