Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2847270pxk; Sun, 20 Sep 2020 20:30:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSfz7PTU9bN4lsOaNDt4BnbvDycoyC4S3VMNjAvQo0oFz5b53OQDQMm72B2aCObBHcTKNM X-Received: by 2002:a50:cdd1:: with SMTP id h17mr51133180edj.94.1600659050678; Sun, 20 Sep 2020 20:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600659050; cv=none; d=google.com; s=arc-20160816; b=W+5cDCRL1t+quWqhckn1SbAEe/mZBHh4Q5rC4khqhh60bwUT8VLuNBCK1XzEnKEL5F dBGG1wFjeIz8K9mrmiSiKZRNd3x3i5MLBCFxtPtM03QW8xlOxHqSQ8STeo6fYOjMV5de fba1VHMqp8FDNsw6slT11cALle7GFa8ZIYRko9DnC1nhWfCHMioCdieI3x2I1/SHoAzC WsUX0XIo8x5iSuumkiB97yQyWOLqoXlobIwNCgPecX1TD3UhZvKmufmMHmlBP7QAEiHl nZDSfp1fNQaQqqdjNp7QBDvkR2xBBE+T6/pQ9buKaBkLwWHGZS6xM1NpOEQ+OBTRbtqi X3lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=c0nzXINZP0bSdeHVxqLZwwWNYCcsG5wgq2I/1U8kHgA=; b=SJSqR6nn1R0Am/2A9CrPyFQGxXOSAW6c2me5YD3VFtbtnHPTMXQtycKwdCOUdhTXfi FlJto2yB1ZkvqrEg8cVIjiBKDKnxYoOMrvrLFCMN4ikQHpDFxRn/NYh4mbY7kjQJ7xW5 vvAQ5P7rk40hUXjXdwpmF83T6qD3IxXelTGqMsuinQMtcVYBDkegyAWdwt1nCKaJ1Uqa bZmS7Frlb+uu7KIhbPvimjhUk+SoWf3KnfO+CVk7PmrqWBXF8JkR0WWFTrNkmJTd0Hc9 drV+gHbCCW5f5+0TVNwUkXq2Lhphd2VinSbRn9QWcexxFMSYo6rNc2hqkXm9l0jITk7G v+kA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q7si7643325ejy.607.2020.09.20.20.30.27; Sun, 20 Sep 2020 20:30:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbgIUD17 (ORCPT + 99 others); Sun, 20 Sep 2020 23:27:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13780 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726210AbgIUD17 (ORCPT ); Sun, 20 Sep 2020 23:27:59 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 47F6B33E13999926F05A; Mon, 21 Sep 2020 11:27:56 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 11:27:48 +0800 From: Tian Tao To: , , , , , , , , CC: Subject: [PATCH drm/hisilicon 3/3] drm/hisilicon: Releasing Resources in the Destroy callback Function Date: Mon, 21 Sep 2020 11:25:22 +0800 Message-ID: <1600658722-35945-4-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1600658722-35945-1-git-send-email-tiantao6@hisilicon.com> References: <1600658722-35945-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rewrite the desrtoy callback function to release resources. Signed-off-by: Tian Tao --- 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