msm_hdmi_unbind() fetches its struct hdmi indirectly through priv->kms->hdmi. The hdmi structure is already stored as the driver data of the HDMI device (and retrieved that way in msm_hdmi_bind()), so use dev_get_drvdata() here too. The hdmi pointer is always valid at unbind time, so the priv->kms->hdmi check can be dropped as well.
Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Dmitry Baryshkov <[email protected]> --- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi.c b/drivers/gpu/drm/msm/hdmi/hdmi.c index 506a9856459e..0327098287d1 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi.c @@ -324,11 +324,10 @@ static void msm_hdmi_unbind(struct device *dev, struct device *master, void *data) { struct msm_drm_private *priv = dev_get_drvdata(master); + struct hdmi *hdmi = dev_get_drvdata(dev); - if (priv->kms->hdmi) { - msm_hdmi_destroy(priv->kms->hdmi); - priv->kms->hdmi = NULL; - } + msm_hdmi_destroy(hdmi); + priv->kms->hdmi = NULL; } static const struct component_ops msm_hdmi_ops = { -- 2.47.3
