From patchwork Sun Nov 3 13:31:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3133541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B7089F3C4 for ; Sun, 3 Nov 2013 13:33:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5179C2031C for ; Sun, 3 Nov 2013 13:33:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 68BD42035C for ; Sun, 3 Nov 2013 13:33:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A7C00EE9DA; Sun, 3 Nov 2013 05:33:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by gabe.freedesktop.org (Postfix) with ESMTP id D2581EE9D0 for ; Sun, 3 Nov 2013 05:31:31 -0800 (PST) Received: by mail-ea0-f171.google.com with SMTP id h10so2897566eak.16 for ; Sun, 03 Nov 2013 05:31:27 -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; bh=Yp+Yb4bYn/uYcJHn/bDYWqNL0OxRg741Am3TSD6JXiw=; b=RNC5nho8x4oXY0BSgPEEAwkZzWshEO26Je5sKMWC+tdUlj1cz5AkrEbDyDUdv49HVn 77ycQvwP0hLlpoWotyPomgCpVh/EK5txhiWIxJhL2omJAIHt3dj3CDSFCgoAPuocsE7a VDIkUV5f7jUNWD0AFrwLS1NZhgJlQOU8aJw6A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Yp+Yb4bYn/uYcJHn/bDYWqNL0OxRg741Am3TSD6JXiw=; b=Os4A7I147PZ35bXFAXFv600t59LbzbrvjXpbgUWrgKKppJ1ST3wh0Dca1a9WW7xTTW VFx2MNw+jRI/+ltyFI8HSDC0uBjUUlrPR/pRJ8X3N5AUgrRRMKzaqu8dGVuOi9RU9v4b P5Lm0oVJWYpw6HmtGCI3Pq8tYD2/8m0e39Ynh9Cs5fMh5htwL/9q2jYalII/bjo2TF7J gMsk+D1vRtbFEM8L66hkWUDpv9GPvEIxsG3pusHCYLJCahpH5f1I6WU2b8jMXxIBXEe8 OTU1LdPuS/xgoYBSYbfAlMfMZHSMEkSxH36lshvsqNAuazw3sU8HIA/kSRNW9hT40OV7 VUSw== X-Gm-Message-State: ALoCoQk5c49t8SYkPoayuj73f1o3F6WfwIis9P0pcQWlsbp2qQ9pJjUhwJAiPHhTQBRqERZZ3hLm X-Received: by 10.14.198.197 with SMTP id v45mr2090254een.52.1383485487285; Sun, 03 Nov 2013 05:31:27 -0800 (PST) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id b42sm33440171eem.9.2013.11.03.05.31.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Nov 2013 05:31:26 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 18/19] drm: kill the ->agp_destroy callback Date: Sun, 3 Nov 2013 14:31:24 +0100 Message-Id: <1383485485-8210-19-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1383485485-8210-1-git-send-email-daniel.vetter@ffwll.ch> References: <1383485485-8210-1-git-send-email-daniel.vetter@ffwll.ch> Cc: Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call drm_pci_agp_destroy directly, there's no point in the indirection. Long term we want to shuffle this into each driver's unload logic, but that needs cleared-up drm lifetime rules first. Signed-off-by: Daniel Vetter Reviewed-by: David Herrmann --- drivers/gpu/drm/drm_pci.c | 3 +-- drivers/gpu/drm/drm_stub.c | 4 ++-- include/drm/drmP.h | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index d0937dd62899..36e7f8e74027 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -276,7 +276,7 @@ static void drm_pci_agp_init(struct drm_device *dev) } } -static void drm_pci_agp_destroy(struct drm_device *dev) +void drm_pci_agp_destroy(struct drm_device *dev) { if (dev->agp) { arch_phys_wc_del(dev->agp->agp_mtrr); @@ -292,7 +292,6 @@ static struct drm_bus drm_pci_bus = { .get_name = drm_pci_get_name, .set_busid = drm_pci_set_busid, .set_unique = drm_pci_set_unique, - .agp_destroy = drm_pci_agp_destroy, }; /** diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 4b25f693ae89..3ec8d4f9f09a 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -569,8 +569,8 @@ void drm_dev_unregister(struct drm_device *dev) if (dev->driver->unload) dev->driver->unload(dev); - if (dev->driver->bus->agp_destroy) - dev->driver->bus->agp_destroy(dev); + if (dev->agp) + drm_pci_agp_destroy(dev); drm_vblank_cleanup(dev); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 8cf8cfef8c56..f67104aa7b51 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -748,9 +748,6 @@ struct drm_bus { int (*set_unique)(struct drm_device *dev, struct drm_master *master, struct drm_unique *unique); int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p); - /* hooks that are for PCI */ - void (*agp_destroy)(struct drm_device *dev); - }; /** @@ -1658,6 +1655,7 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev) return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); } +void drm_pci_agp_destroy(struct drm_device *dev); extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);