aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp_mst.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2018-10-09 10:11:03 -0400
committerJani Nikula <jani.nikula@intel.com>2018-10-09 16:03:15 -0400
commitd4b26e4f438f0b070fbcd1e765fb53db9ac59112 (patch)
treeea28c8318ad62372000c76dfd740e682024fd5f4 /drivers/gpu/drm/i915/intel_dp_mst.c
parenta9f9ca33d1fe9325f414914be526c0fc4ba5281c (diff)
drm/i915: add a common connector type independent destroy hook
Almost all of the connector destroy functions do the same thing. The differences are in the edid, detect_edid and panel cleanups, but those are safely NULL when not initialized. Roll out a common connector destroy hook. Inspired by commit bc3213c44415 ("drm/i915: Drop the eDP check from intel_dp_connector_destroy()"). Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181009141103.20387-1-jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp_mst.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp_mst.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index 7f155b4f1a7d..bb6b8f03e9b5 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -335,24 +335,12 @@ intel_dp_mst_detect(struct drm_connector *connector, bool force)
335 intel_connector->port); 335 intel_connector->port);
336} 336}
337 337
338static void
339intel_dp_mst_connector_destroy(struct drm_connector *connector)
340{
341 struct intel_connector *intel_connector = to_intel_connector(connector);
342
343 if (!IS_ERR_OR_NULL(intel_connector->edid))
344 kfree(intel_connector->edid);
345
346 drm_connector_cleanup(connector);
347 kfree(connector);
348}
349
350static const struct drm_connector_funcs intel_dp_mst_connector_funcs = { 338static const struct drm_connector_funcs intel_dp_mst_connector_funcs = {
351 .detect = intel_dp_mst_detect, 339 .detect = intel_dp_mst_detect,
352 .fill_modes = drm_helper_probe_single_connector_modes, 340 .fill_modes = drm_helper_probe_single_connector_modes,
353 .late_register = intel_connector_register, 341 .late_register = intel_connector_register,
354 .early_unregister = intel_connector_unregister, 342 .early_unregister = intel_connector_unregister,
355 .destroy = intel_dp_mst_connector_destroy, 343 .destroy = intel_connector_destroy,
356 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, 344 .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
357 .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state, 345 .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
358}; 346};