From patchwork Fri Nov 27 03:14:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "tiantao (H)" X-Patchwork-Id: 11935395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C727C63777 for ; Fri, 27 Nov 2020 10:11:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B6BBC20674 for ; Fri, 27 Nov 2020 10:11:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B6BBC20674 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA58F6EB8C; Fri, 27 Nov 2020 10:11:39 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by gabe.freedesktop.org (Postfix) with ESMTPS id E50046EB5A for ; Fri, 27 Nov 2020 03:14:27 +0000 (UTC) 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: , , 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 X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected X-Mailman-Approved-At: Fri, 27 Nov 2020 10:11:27 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Reported-by: kernel test robot Reported-by: kernel test robot --- 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); }