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

On Wed, 2024-07-31 at 14:13 -0600, Rob Herring (Arm) wrote:
>
> External email : Please do not click links or open attachments until you have verified the sender or the content.
> of_property_read_u32() returns -EINVAL if a property is not present, so
> the preceeding check for presence with of_find_property() can be
> dropped. Really, what the errno is shouldn't matter. Either the property
> can be read and used or it can't and is ignored.
>
> This is part of a larger effort to remove callers of of_find_property()
> and similar functions. of_find_property() leaks the DT struct property
> and data pointers which is a problem for dynamically allocated nodes
> which may be freed.

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

>
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> drivers/gpu/drm/mediatek/mtk_disp_rdma.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> index 634bbba5d43f..07243f372260 100644
> --- a/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> +++ b/drivers/gpu/drm/mediatek/mtk_disp_rdma.c
> @@ -341,14 +341,11 @@ static int mtk_disp_rdma_probe(struct platform_device *pdev)
> dev_dbg(dev, "get mediatek,gce-client-reg fail!\n");
> #endif
>
> -if (of_find_property(dev->of_node, "mediatek,rdma-fifo-size", &ret)) {
> -ret = of_property_read_u32(dev->of_node,
> - "mediatek,rdma-fifo-size",
> - &priv->fifo_size);
> -if (ret)
> -return dev_err_probe(dev, ret,
> - "Failed to get rdma fifo size\n");
> -}
> +ret = of_property_read_u32(dev->of_node,
> + "mediatek,rdma-fifo-size",
> + &priv->fifo_size);
> +if (ret && (ret != -EINVAL))
> +return dev_err_probe(dev, ret, "Failed to get rdma fifo size\n");
>
> /* Disable and clear pending interrupts */
> writel(0x0, priv->regs + DISP_REG_RDMA_INT_ENABLE);
> --
> 2.43.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><!--}-->