drm/mediatek: dp: Add missing error checks in mtk_dp_parse_capabilities
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tue, 25 Jul 2023 07:32:24 +0000 (09:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:43 +0000 (09:42 +0200)
commitb625a6eaf2bf4ec7f962a26805b6d1927e3e8442
treeb6d7ba00f6eb59082d8251c203ed3b1a8111969c
parent0c323430e470c922af54cebf1134d7b62144ecfa
drm/mediatek: dp: Add missing error checks in mtk_dp_parse_capabilities

[ Upstream commit cfc146137a9f12e883ba64bc496b6da4d23f26d5 ]

If reading the RX capabilities fails the training pattern will be set
wrongly: add error checking for drm_dp_read_dpcd_caps() and return if
anything went wrong with it.

While at it, also add a less critical error check when writing to
clear the ESI0 IRQ vector.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230725073234.55892-2-angelogioacchino.delregno@collabora.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/mediatek/mtk_dp.c