From patchwork Fri Dec 20 11:59:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 11305259 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C382313A4 for ; Fri, 20 Dec 2019 12:00:00 +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 A0C0624679 for ; Fri, 20 Dec 2019 12:00:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XerEBZgv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0C0624679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.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 016436EC19; Fri, 20 Dec 2019 11:59:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2AB876EC19 for ; Fri, 20 Dec 2019 11:59:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576843187; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=aOOYqVPrj4S2St31AUk2Ye43S8BIUm6kjTFmGx5Z+/A=; b=XerEBZgvnVkhaWBGF/bC0AlydKVk83Y+aF8Tvrem9M9EU3/ux866UlOy84S7u3ZnpVcdUy RwbGOgF358DIoQUt4SNelb9BqBnhkntuge/+qzKAfqtA5OeiQRtowgsBX37ejIWx02Da0e dPK+XcD2+oVHS8Y8fpPBXUygrW8PAnc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-340-rVnDIYr_NoWoY4vSySONOQ-1; Fri, 20 Dec 2019 06:59:40 -0500 X-MC-Unique: rVnDIYr_NoWoY4vSySONOQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 349FB107ACC7; Fri, 20 Dec 2019 11:59:39 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-98.ams2.redhat.com [10.36.116.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3BF087D9D4; Fri, 20 Dec 2019 11:59:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 79C463F13D; Fri, 20 Dec 2019 12:59:35 +0100 (CET) From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/bochs: add drm_driver.release callback. Date: Fri, 20 Dec 2019 12:59:32 +0100 Message-Id: <20191220115935.15152-2-kraxel@redhat.com> In-Reply-To: <20191220115935.15152-1-kraxel@redhat.com> References: <20191220115935.15152-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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: David Airlie , open list , "open list:DRM DRIVER FOR BOCHS VIRTUAL GPU" , Gerd Hoffmann , Gurchetan Singh MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Gurchetan Singh Move bochs_unload call from bochs_remove() to the new bochs_release() callback. Also call drm_dev_unregister() first in bochs_remove(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index 10460878414e..87ee1eb21a4d 100644 --- a/drivers/gpu/drm/bochs/bochs_drv.c +++ b/drivers/gpu/drm/bochs/bochs_drv.c @@ -60,6 +60,11 @@ static int bochs_load(struct drm_device *dev) DEFINE_DRM_GEM_FOPS(bochs_fops); +static void bochs_release(struct drm_device *dev) +{ + bochs_unload(dev); +} + static struct drm_driver bochs_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &bochs_fops, @@ -69,6 +74,7 @@ static struct drm_driver bochs_driver = { .major = 1, .minor = 0, DRM_GEM_VRAM_DRIVER, + .release = bochs_release, }; /* ---------------------------------------------------------------------- */ @@ -148,9 +154,8 @@ static void bochs_pci_remove(struct pci_dev *pdev) { struct drm_device *dev = pci_get_drvdata(pdev); - drm_atomic_helper_shutdown(dev); drm_dev_unregister(dev); - bochs_unload(dev); + drm_atomic_helper_shutdown(dev); drm_dev_put(dev); }