]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/mediatek: Drop unnecessary check for property presence
authorRob Herring (Arm) <robh@kernel.org>
Wed, 31 Jul 2024 20:13:56 +0000 (14:13 -0600)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Thu, 29 Aug 2024 14:26:14 +0000 (14:26 +0000)
commit00335fc7cc7a8a39bff2fddd48be854b98c693ab
tree2b99e7bb0704c028729498d5dd82ab1410dfeddc
parent103b90752f3dda74abc56993390fa303147e7fbc
drm/mediatek: Drop unnecessary check for property presence

of_property_read_u32() returns -EINVAL if a property is not present, so
the preceding 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.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240731201407.1838385-1-robh@kernel.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_disp_rdma.c