Message ID | 20200219102122.1607365-9-daniel.vetter@ffwll.ch (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=+qBX=4H=lists.freedesktop.org=dri-devel-bounces@kernel.org> 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 603D3930 for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 19 Feb 2020 10:22:17 +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 3DB182464E for <patchwork-dri-devel@patchwork.kernel.org>; Wed, 19 Feb 2020 10:22:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="I0KTH0Uk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3DB182464E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch 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 CA92B6EB42; Wed, 19 Feb 2020 10:21:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1A016EB2E for <dri-devel@lists.freedesktop.org>; Wed, 19 Feb 2020 10:21:42 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id y11so27503568wrt.6 for <dri-devel@lists.freedesktop.org>; Wed, 19 Feb 2020 02:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jGkQy6GARMrTdcko1Rer3WUnvLpzhV0C66wlxAxhWNE=; b=I0KTH0UkBAvrOSijIO4+h7syZUN60LJupdfC6Nj/MjoFy01AeAyKX6hS3qK8A/nkPH Z+KpeWnSVlILc6CexbTKyKQ81hlEAbn+VNwRgcLRub/S6F6bJGGQvb756PmOCyEiI3fQ VFPwmZfHfBlC3fQjWz4WQdz70krfrRUgkgv8s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jGkQy6GARMrTdcko1Rer3WUnvLpzhV0C66wlxAxhWNE=; b=e9sHmfiGSNsF23hnFFvScWVdrSODj1Y4xXvR9UY43zBsqRiBz6mQ2bjaxKsWZwnbTX aCYP0+1BHtZ2TWYgraSwqliCseFJSDuv5uTTAb+bc9mgkcjCoNWsUdxsgPYR6mAlUXPh Ac55jY0Jc2vnwkv5jK+nsnh/JbvnmAH5W26qSb8Uqp1ykPW6lTHZUTMHQQOZJbBBuyih 2316RJd6QWfs/YvzVuo/jOW/LZsbjIqxCwfN/Ut6dpWvCBctUKEW0eXSjJC9bvVO1mHa Oh5fpFePf16z6EgjiLnZ+kTbzMEwDUzrkZK0BqDVdl4Of0XW7XcHaEwr4p69MeJ8TeZx 6vQA== X-Gm-Message-State: APjAAAWvhRBDCOcazh2ldVMEa0enQp7cTDc1NwD5hDN9djheYnSzuQ/h xRy1DEJYpD8xbUwbaSSSx7u6PZWYZqE= X-Google-Smtp-Source: APXvYqxytavNXoCPEGoURGrJpjzYeGuccrYtk5frvOQ50HTSIjjncj6zXH9yKZW8W08f70W0KjTN+g== X-Received: by 2002:a5d:5452:: with SMTP id w18mr33447398wrv.333.1582107701051; Wed, 19 Feb 2020 02:21:41 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id s23sm2370339wra.15.2020.02.19.02.21.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 02:21:40 -0800 (PST) From: Daniel Vetter <daniel.vetter@ffwll.ch> To: DRI Development <dri-devel@lists.freedesktop.org> Subject: [PATCH 08/52] drm/qxl: Use drmm_add_final_kfree Date: Wed, 19 Feb 2020 11:20:38 +0100 Message-Id: <20200219102122.1607365-9-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200219102122.1607365-1-daniel.vetter@ffwll.ch> References: <20200219102122.1607365-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: spice-devel@lists.freedesktop.org, Daniel Vetter <daniel.vetter@ffwll.ch>, Intel Graphics Development <intel-gfx@lists.freedesktop.org>, virtualization@lists.linux-foundation.org, Gerd Hoffmann <kraxel@redhat.com>, Daniel Vetter <daniel.vetter@intel.com>, Dave Airlie <airlied@redhat.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
drm_device managed resources
|
expand
|
diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index 4fda3f9b29f4..09102e2efabc 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -144,8 +144,6 @@ static void qxl_drm_release(struct drm_device *dev) */ qxl_modeset_fini(qdev); qxl_device_fini(qdev); - dev->dev_private = NULL; - kfree(qdev); } static void diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index 70b20ee4741a..09d7b5f6d172 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -27,6 +27,7 @@ #include <linux/pci.h> #include <drm/drm_drv.h> +#include <drm/drm_managed.h> #include <drm/drm_probe_helper.h> #include "qxl_drv.h" @@ -121,6 +122,7 @@ int qxl_device_init(struct qxl_device *qdev, qdev->ddev.pdev = pdev; pci_set_drvdata(pdev, &qdev->ddev); qdev->ddev.dev_private = qdev; + drmm_add_final_kfree(&qdev->ddev, qdev); mutex_init(&qdev->gem.mutex); mutex_init(&qdev->update_area_mutex);
With this we can drop the final kfree from the release function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: virtualization@lists.linux-foundation.org Cc: spice-devel@lists.freedesktop.org --- drivers/gpu/drm/qxl/qxl_drv.c | 2 -- drivers/gpu/drm/qxl/qxl_kms.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-)