drm/mediatek: clean up driver data initialisation
authorJohan Hovold <johan@kernel.org>
Fri, 29 Aug 2025 09:03:45 +0000 (11:03 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 10 Sep 2025 12:52:59 +0000 (12:52 +0000)
commit9ba2556cef1df746fad4d691c8290e235b23c7d1
tree5e626f8517dce407c19a95002f3338a06eb1ac3c
parent4de37a48b6b58faaded9eb765047cf0d8785ea18
drm/mediatek: clean up driver data initialisation

The platform and drm devices are only used to look up the drm device and
its driver data respectively when initialising the driver data during
bind().

Drop the reference counts as soon as they have been used to make the
code more readable.

Note that the crtc count is never incremented on lookup failures.

Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20250829090345.21075-3-johan@kernel.org/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_drm_drv.c