[PATCH 1/3] drm/mediatek: mtk_dp: Fix hdmi codec and phy driver unregistration
Dmitry Baryshkov
dmitry.baryshkov at oss.qualcomm.com
Wed Sep 24 18:09:47 PDT 2025
On Wed, Sep 24, 2025 at 12:37:06PM +0200, AngeloGioacchino Del Regno wrote:
> During probe, this driver is registering two platform devices: one
> for the HDMI Codec driver and one for the DisplayPort PHY driver.
>
> In the probe function, none of the error cases are unregistering
> any of the two platform devices and this may cause registration
> of multiple instances of those in case this driver returns one or
> more probe deferral(s) in the "wrong" spots.
>
> In order to fix this, add devm actions to unregister those and
> remove the manual calls to platform_device_unregister in the
> mtk_dp_remove() function, as those would otherwise be redundant.
>
> Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195")
> Fixes: caf2ae486742 ("drm/mediatek: dp: Add support for embedded DisplayPort aux-bus")
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
> ---
> drivers/gpu/drm/mediatek/mtk_dp.c | 30 ++++++++++++++++++++++++++----
> 1 file changed, 26 insertions(+), 4 deletions(-)
>
You can save yourself from all these troubles if you store the
registered device at connector->hdmi_audio.codec_pdev (see
drm_connector_cleanup()).
And of course, you might use DRM_BRIDGE_OP_DP_AUDIO in order to reduce
code duplication.
--
With best wishes
Dmitry
More information about the linux-arm-kernel
mailing list