Merge tag 'acpi-extra-4.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafae...
[deliverable/linux.git] / drivers / gpu / drm / sti / sti_hda.c
index dcec5a8eda592e36b86a90d27f243665ed3adeee..8505569f75deec1489fec0f3a74b7ccf8f3067b5 100644 (file)
@@ -681,24 +681,29 @@ sti_hda_connector_detect(struct drm_connector *connector, bool force)
        return connector_status_connected;
 }
 
-static void sti_hda_connector_destroy(struct drm_connector *connector)
+static int sti_hda_late_register(struct drm_connector *connector)
 {
        struct sti_hda_connector *hda_connector
                = to_sti_hda_connector(connector);
+       struct sti_hda *hda = hda_connector->hda;
+
+       if (hda_debugfs_init(hda, hda->drm_dev->primary)) {
+               DRM_ERROR("HDA debugfs setup failed\n");
+               return -EINVAL;
+       }
 
-       drm_connector_unregister(connector);
-       drm_connector_cleanup(connector);
-       kfree(hda_connector);
+       return 0;
 }
 
 static const struct drm_connector_funcs sti_hda_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = sti_hda_connector_detect,
-       .destroy = sti_hda_connector_destroy,
+       .destroy = drm_connector_cleanup,
        .reset = drm_atomic_helper_connector_reset,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+       .late_register = sti_hda_late_register,
 };
 
 static struct drm_encoder *sti_hda_find_encoder(struct drm_device *dev)
@@ -756,10 +761,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
        drm_connector_helper_add(drm_connector,
                        &sti_hda_connector_helper_funcs);
 
-       err = drm_connector_register(drm_connector);
-       if (err)
-               goto err_connector;
-
        err = drm_mode_connector_attach_encoder(drm_connector, encoder);
        if (err) {
                DRM_ERROR("Failed to attach a connector to a encoder\n");
@@ -769,15 +770,10 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)
        /* force to disable hd dacs at startup */
        hda_enable_hd_dacs(hda, false);
 
-       if (hda_debugfs_init(hda, drm_dev->primary))
-               DRM_ERROR("HDA debugfs setup failed\n");
-
        return 0;
 
 err_sysfs:
-       drm_connector_unregister(drm_connector);
-err_connector:
-       drm_connector_cleanup(drm_connector);
+       drm_bridge_remove(bridge);
        return -EINVAL;
 }
 
This page took 0.025472 seconds and 5 git commands to generate.