]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm: Remove drm dp mst destroy_connector callbacks
authorPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Sat, 7 Mar 2020 08:30:23 +0000 (14:00 +0530)
committerLyude Paul <lyude@redhat.com>
Wed, 11 Mar 2020 20:53:17 +0000 (16:53 -0400)
drm_dp_mst_topology_mgr_cbs.destroy_connector callbacks are identical
amongst every driver and don't do anything other than cleaning up the
connector((drm_connector_unregister()/drm_connector_put())) except for
amdgpu_dm driver where some amdgpu_dm specific code in there.

This connector cleaning up is now being handled in the drm core so
driver destroy_connector callbacks are not needed (except for
amdgpu_dm) hence remove them.

Removal is done with below sementic patch:

@r1@
identifier func, E;
@@
struct drm_dp_mst_topology_cbs E = {
...,
-        .destroy_connector = func
};

@delete depends on r1@
identifier r1.func;
@@
- static void func(...){...}

Signed-off-by: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Suggested-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200307083023.76498-6-pankaj.laxminarayan.bharadiya@intel.com
Reviewed-by: Lyude Paul <lyude@redhat.com>
drivers/gpu/drm/i915/display/intel_dp_mst.c
drivers/gpu/drm/nouveau/dispnv50/disp.c
drivers/gpu/drm/radeon/radeon_dp_mst.c

index 262f50897ff11fb12a0124dd70766ca99cb19b62..306c1549a680e2d4fa5bedf187da13ed6935b141 100644 (file)
@@ -719,18 +719,8 @@ err:
        return NULL;
 }
 
-static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
-                                          struct drm_connector *connector)
-{
-       DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name);
-       drm_connector_unregister(connector);
-
-       drm_connector_put(connector);
-}
-
 static const struct drm_dp_mst_topology_cbs mst_cbs = {
        .add_connector = intel_dp_add_mst_connector,
-       .destroy_connector = intel_dp_destroy_mst_connector,
 };
 
 static struct intel_dp_mst_encoder *
index 4e391707379766611c6009a1ed287e7947697890..4d1c58468dbcaf71541b1bf04265659b6723a17b 100644 (file)
@@ -1256,17 +1256,6 @@ nv50_mstm_prepare(struct nv50_mstm *mstm)
        }
 }
 
-static void
-nv50_mstm_destroy_connector(struct drm_dp_mst_topology_mgr *mgr,
-                           struct drm_connector *connector)
-{
-       struct nv50_mstc *mstc = nv50_mstc(connector);
-
-       drm_connector_unregister(&mstc->connector);
-
-       drm_connector_put(&mstc->connector);
-}
-
 static struct drm_connector *
 nv50_mstm_add_connector(struct drm_dp_mst_topology_mgr *mgr,
                        struct drm_dp_mst_port *port, const char *path)
@@ -1285,7 +1274,6 @@ nv50_mstm_add_connector(struct drm_dp_mst_topology_mgr *mgr,
 static const struct drm_dp_mst_topology_cbs
 nv50_mstm = {
        .add_connector = nv50_mstm_add_connector,
-       .destroy_connector = nv50_mstm_destroy_connector,
 };
 
 void
index 795e2df773ae359c2d4da1b0bef4319116ffc1b0..008308780443c83bbaa9f51c5a1856c76d4ff213 100644 (file)
@@ -301,19 +301,8 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol
        return connector;
 }
 
-static void radeon_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
-                                           struct drm_connector *connector)
-{
-       drm_connector_unregister(connector);
-       drm_connector_cleanup(connector);
-
-       kfree(connector);
-       DRM_DEBUG_KMS("\n");
-}
-
 static const struct drm_dp_mst_topology_cbs mst_cbs = {
        .add_connector = radeon_dp_add_mst_connector,
-       .destroy_connector = radeon_dp_destroy_mst_connector,
 };
 
 static struct