Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1159814pxu; Fri, 27 Nov 2020 00:48:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQ3tCRqGoTBnSyaFVwW7SI+JGr0IRTEiF57aYOLuoMmJOArXxgGY61vzvQXO3kQGUbrmEi X-Received: by 2002:aa7:ce82:: with SMTP id y2mr6556567edv.6.1606466938153; Fri, 27 Nov 2020 00:48:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606466938; cv=none; d=google.com; s=arc-20160816; b=S32sS6q2j9AZ2l3n7IkTDOfDaFsQhOLTC1D4Q66xnMph0R4Pl6XfGg7P0mmjtXnBJd 7QiQ53Gz374aU2A3bYoYBL4pFZnVarb1StlPQ4yvNokHCUlD6amyNK/N1avfWTxLadSR EVFa+ffZQTFPN8d+xjVrFD7wzEqV/Zm/Y8BXG0zRL9C6M3KlZORYFzhaMFTpIppHOFUI 0r+kdRJzkAwAwa4/I3Mnai1N3Ti+fVPXFVY3NaLPqN/ve+i6WsH5Kj85FI6vLkfKEIhm T/effg6ZmrdgioeUa8s1x/vaX2VEotbUxescE1GTsEGOAikQ1/9Zt8CTN07uLka9B5e1 PxDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=kxiRxQ3jIX+jhcchh5/tqILNa5zkHpvVrXSGCOb2kKc=; b=JpnQsau7Uj8PKxWMO23DWP5DUUwfqnXId3LUKWYkW7HCkpFtZ/99UMFGAl0Bv8y7iD KwW8s7fkgzwm+7f821twl/9oRs4pFGjdR8q0QQOYhbFG59vV72oRLkTMmV5uM7QNXTGz 1Pgpgq8fMZmrTiatPNR2OgDytHSx8nyrCnjFwU8KnHIcSpTeVctDEoUaM0e6PhijgpgG jygePsFXJW7wtuhbI3PIfJMcHNVS7W7YNCYj1AA2m6ew9zynRE2/2lNQpHSH+SBwpNm2 bfI+lD0KStLE//f9niqXrGYFGgTLd6cQKOHiuVcdz0iwVfl+psG3QRBJnvNu39wBZoMl 9U/w== 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 n7si2493391ejz.458.2020.11.27.00.48.36; Fri, 27 Nov 2020 00:48:58 -0800 (PST) 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 S2392287AbgK0DOZ (ORCPT + 99 others); Thu, 26 Nov 2020 22:14:25 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8598 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730781AbgK0DOZ (ORCPT ); Thu, 26 Nov 2020 22:14:25 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cj08K4S4TzLt25; Fri, 27 Nov 2020 11:13:53 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Fri, 27 Nov 2020 11:14:21 +0800 From: Tian Tao To: , , CC: , Subject: [PATCH] drm/vboxvideo: Used the vram helper Date: Fri, 27 Nov 2020 11:14:42 +0800 Message-ID: <1606446882-36335-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 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 if the driver uses drmm_vram_helper_init, there is no need to call drm_vram_helper_release_mm when the drm module get unloaded, as this will done automagically. Signed-off-by: Tian Tao --- drivers/gpu/drm/vboxvideo/vbox_ttm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vboxvideo/vbox_ttm.c b/drivers/gpu/drm/vboxvideo/vbox_ttm.c index f5a0667..e1909a8 100644 --- a/drivers/gpu/drm/vboxvideo/vbox_ttm.c +++ b/drivers/gpu/drm/vboxvideo/vbox_ttm.c @@ -16,8 +16,8 @@ int vbox_mm_init(struct vbox_private *vbox) int ret; struct drm_device *dev = &vbox->ddev; - vmm = drm_vram_helper_alloc_mm(dev, pci_resource_start(dev->pdev, 0), - vbox->available_vram_size); + vmm = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0), + vbox->available_vram_size); if (IS_ERR(vmm)) { ret = PTR_ERR(vmm); DRM_ERROR("Error initializing VRAM MM; %d\n", ret); @@ -32,5 +32,4 @@ int vbox_mm_init(struct vbox_private *vbox) void vbox_mm_fini(struct vbox_private *vbox) { arch_phys_wc_del(vbox->fb_mtrr); - drm_vram_helper_release_mm(&vbox->ddev); } -- 2.7.4