mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tian Tao <tiantao6@hisilicon.com>
To: <airlied@linux.ie>, <daniel@ffwll.ch>, <tzimmermann@suse.de>,
	<kraxel@redhat.com>, <alexander.deucher@amd.com>,
	<tglx@linutronix.de>, <dri-devel@lists.freedesktop.org>,
	<xinliang.liu@linaro.org>, <linux-kernel@vger.kernel.org>
Cc: <linuxarm@huawei.com>
Subject: [PATCH drm/hisilicon 3/3] drm/hisilicon: Releasing Resources in the Destroy callback Function
Date: Mon, 21 Sep 2020 11:25:22 +0800	[thread overview]
Message-ID: <1600658722-35945-4-git-send-email-tiantao6@hisilicon.com> (raw)
In-Reply-To: <1600658722-35945-1-git-send-email-tiantao6@hisilicon.com>

Rewrite the desrtoy callback function to release resources.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
index e84d381..f1541ff 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_vdac.c
@@ -47,6 +47,14 @@ static enum drm_mode_status hibmc_connector_mode_valid(struct drm_connector *con
 	return MODE_OK;
 }
 
+static void hibmc_connector_destroy(struct drm_connector *connector)
+{
+	struct hibmc_connector *hibmc_connector = to_hibmc_connector(connector);
+
+	i2c_del_adapter(&hibmc_connector->adapter);
+	drm_connector_cleanup(connector);
+}
+
 static const struct drm_connector_helper_funcs
 	hibmc_connector_helper_funcs = {
 	.get_modes = hibmc_connector_get_modes,
@@ -55,7 +63,7 @@ static const struct drm_connector_helper_funcs
 
 static const struct drm_connector_funcs hibmc_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
-	.destroy = drm_connector_cleanup,
+	.destroy = hibmc_connector_destroy,
 	.reset = drm_atomic_helper_connector_reset,
 	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
 	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
-- 
2.7.4


  parent reply	other threads:[~2020-09-21  3:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21  3:25 [PATCH drm/hisilicon 0/3] support reading resolutions from EDID Tian Tao
2020-09-21  3:25 ` [PATCH drm/hisilicon 1/3] drm/hisilicon: Support i2c driver algorithms for bit-shift adapters Tian Tao
2020-09-21  7:20   ` Thomas Zimmermann
2020-09-21  3:25 ` [PATCH drm/hisilicon 2/3] drm/hisilicon: Features to support reading resolutions from EDID Tian Tao
2020-09-21  7:25   ` Thomas Zimmermann
2020-09-21  3:25 ` Tian Tao [this message]
2020-09-21  7:26   ` [PATCH drm/hisilicon 3/3] drm/hisilicon: Releasing Resources in the Destroy callback Function Thomas Zimmermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1600658722-35945-4-git-send-email-tiantao6@hisilicon.com \
    --to=tiantao6@hisilicon.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=tglx@linutronix.de \
    --cc=tzimmermann@suse.de \
    --cc=xinliang.liu@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®