From patchwork Wed Dec 11 10:34:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 3324161 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 BC2579F37A for ; Wed, 11 Dec 2013 10:36:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B33020726 for ; Wed, 11 Dec 2013 10:36:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 672A2206D8 for ; Wed, 11 Dec 2013 10:36:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DFCFFB5CD; Wed, 11 Dec 2013 02:36:42 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 108E4FB4DD for ; Wed, 11 Dec 2013 02:34:52 -0800 (PST) Received: by mail-ea0-f174.google.com with SMTP id b10so2740586eae.5 for ; Wed, 11 Dec 2013 02:34:52 -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=5lfGvYSG285fAsewWtiiN01Z6cEm2jLtj0irAxLk7DI=; b=Pmy4t2DJBb7j4rdLVZ9XRmkuNNljMbBVM4+lDOwcBk0+EZudX/m6zRtVLE2HMDDHRZ WPM224+NXkjXh8Z4yZ9vKdNNIMKCJT0nIFvZZtIC1qmerIiMWNv7TuNIeCBgJ2a31oGV 0pP3L8HhYoaFsb8PqkT+A0k39YnoSRJrR0OQk= 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=5lfGvYSG285fAsewWtiiN01Z6cEm2jLtj0irAxLk7DI=; b=d6o6D2LoVRbOY4DUz2KkZaYfrmLyLp3iVrhPTG8gQbzojpyoa1/lYjELQEck73f2UK yidyDoR7NL9xPn0bmjp/fM4EueS/6sU1Ci3t4IPMmd79MfKEvBACcJ9xamBu86SMz71y tgzxVgQTfNwOGb5MGHXIKKk4P/xb7OipY15nbuaChNJbjTTqTRCGWi72YW+i10eUto4q RfmUCQelPFvegDrOcwNMQf2gk4ItA5xT9864L9r8SRwC+DsWBp9RbCpe8Sc0ZgI+0WYQ MBQeemdr9NyPyrz4UJygmNA9Rt0T36prw8jT1UoA4txG3pgPRoE7sCnFWnAmB5RTYvJU T+nw== X-Gm-Message-State: ALoCoQnDAX979H/KZTpks7TMc82G8bmKA0z0epHHP+95i4ZyW4ZYLnoRRnysDyDF54CLEZk7f2bn X-Received: by 10.14.205.201 with SMTP id j49mr835781eeo.85.1386758092381; Wed, 11 Dec 2013 02:34:52 -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 b41sm51932269eef.16.2013.12.11.02.34.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Dec 2013 02:34:51 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH 17/50] drm: kill the ->agp_destroy callback Date: Wed, 11 Dec 2013 11:34:38 +0100 Message-Id: <1386758111-3446-18-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.4.3 In-Reply-To: <1386758111-3446-1-git-send-email-daniel.vetter@ffwll.ch> References: <1386758111-3446-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.3 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. v2: Add a dummy function for !CONFIG_PCI, spotted my David Herrmann. v3: Fixup for the coding style police. Reviewed-by: David Herrmann Cc: David Herrmann Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_pci.c | 4 ++-- drivers/gpu/drm/drm_stub.c | 4 ++-- include/drm/drmP.h | 4 +--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index f710e3d9d847..6dfae6b3c0bc 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); @@ -293,7 +293,6 @@ static struct drm_bus drm_pci_bus = { .set_busid = drm_pci_set_busid, .set_unique = drm_pci_set_unique, .irq_by_busid = drm_pci_irq_by_busid, - .agp_destroy = drm_pci_agp_destroy, }; /** @@ -457,6 +456,7 @@ int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) return -1; } +void drm_pci_agp_destroy(struct drm_device *dev) {} #endif EXPORT_SYMBOL(drm_pci_init); diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 7fca4c6c9a30..6299c197bd6f 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -586,8 +586,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 097d93a6138d..9d4c318f292c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -749,9 +749,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); - }; /** @@ -1643,6 +1640,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);