drm/vc4: hdmi: Fix hotplug extcon uevent to works
[platform/kernel/linux-rpi.git] / drivers / gpu / drm / vc4 / vc4_hdmi.c
index 04791b3..5a20e7b 100644 (file)
@@ -409,7 +409,6 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
 {
        struct drm_connector *connector = &vc4_hdmi->connector;
        struct edid *edid;
-       int ret;
 
        /*
         * NOTE: This function should really be called with
@@ -443,15 +442,6 @@ static void vc4_hdmi_handle_hotplug(struct vc4_hdmi *vc4_hdmi,
        kfree(edid);
 
        vc4_hdmi_reset_link(connector, ctx);
-
-#ifdef CONFIG_EXTCON
-       if (ret != vc4_hdmi->status) {
-               extcon_set_state_sync(vc4_hdmi->edev, EXTCON_DISP_HDMI,
-                                     (status == connector_status_connected ?
-                                     true : false));
-               vc4_hdmi->status = ret;
-       }
-#endif
 }
 
 static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
@@ -488,6 +478,15 @@ static int vc4_hdmi_connector_detect_ctx(struct drm_connector *connector,
        vc4_hdmi_handle_hotplug(vc4_hdmi, ctx, status);
        pm_runtime_put(&vc4_hdmi->pdev->dev);
 
+#ifdef CONFIG_EXTCON
+       if (status != vc4_hdmi->status) {
+               extcon_set_state_sync(vc4_hdmi->edev, EXTCON_DISP_HDMI,
+                                     (status == connector_status_connected ?
+                                     true : false));
+               vc4_hdmi->status = status;
+       }
+#endif
+
        return status;
 }