From patchwork Thu Aug 30 21:00:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 10582833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A456180E for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B4672C32F for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FE802C31D; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BBFE2C347 for ; Thu, 30 Aug 2018 21:06:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727569AbeHaBKI (ORCPT ); Thu, 30 Aug 2018 21:10:08 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:9013 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbeHaBKH (ORCPT ); Thu, 30 Aug 2018 21:10:07 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 421ZcL4BdnzrD; Thu, 30 Aug 2018 22:59:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1535662770; bh=wFbJ95eVVgVvYyOX+YbeKv5yvs/+fwgQV95g8B0g6AI=; h=Date:In-Reply-To:References:From:Subject:To:Cc:Cc:Cc:Cc:Cc:Cc:Cc: Cc:Cc:Cc:Cc:Cc:From; b=qmMBXWC9u9Fp0gSN1bk9XfZna1yiSvasIAupwN4bJYeiu3XqlCb6i54Mh96qMgTad suSbd7FWUOPVw6Fhp4EEF8S1DYD2/CP+sFrmv46lURjwH25XOGBX4d0Wplk2i4VegE WP0/VmG3M8heZzh/fqw6E7BnSdEWAr/l6m2h+trY9LYBILpT+NopgqtIdsHdJJxsMb L0KJOR0oz/voTer7F+wayyJ6PnwiumBHU9dVcMawdZ5fm2VcIO5GK7KywUoafIX+n0 l0fLUdu80enjPtS/gqXH/txTL30cE/+vil9tj8/Q5wDJMunFs1VV9/HEC5UBvtU26K 8D7Ipc1EHTq2A== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.100.0 at mail Date: Thu, 30 Aug 2018 23:00:08 +0200 Message-Id: <66888ed290bb80f8c529af2583611a383e2430f3.1535656077.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= Subject: [PATCH v2 07/12] drm/mgag200: use simpler remove_conflicting_pci_framebuffers() MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Cc: Alex Deucher Cc: Cc: Bartlomiej Zolnierkiewicz Cc: David Airlie Cc: Eric Anholt Cc: Gerd Hoffmann Cc: Cc: Cc: Cc: Maxime Ripard Cc: Thierry Reding Cc: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove duplicated call, while at it. Signed-off-by: Michał Mirosław Acked-by: Daniel Vetter --- drivers/gpu/drm/mgag200/mgag200_drv.c | 21 +-------------------- drivers/gpu/drm/mgag200/mgag200_main.c | 9 --------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag200/mgag200_drv.c index 74cdde2ee474..ac6af4bd9df6 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -42,29 +42,10 @@ static const struct pci_device_id pciidlist[] = { MODULE_DEVICE_TABLE(pci, pciidlist); -static void mgag200_kick_out_firmware_fb(struct pci_dev *pdev) -{ - struct apertures_struct *ap; - bool primary = false; - - ap = alloc_apertures(1); - if (!ap) - return; - - ap->ranges[0].base = pci_resource_start(pdev, 0); - ap->ranges[0].size = pci_resource_len(pdev, 0); - -#ifdef CONFIG_X86 - primary = pdev->resource[PCI_ROM_RESOURCE].flags & IORESOURCE_ROM_SHADOW; -#endif - drm_fb_helper_remove_conflicting_framebuffers(ap, "mgag200drmfb", primary); - kfree(ap); -} - static int mga_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { - mgag200_kick_out_firmware_fb(pdev); + drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, 0, "mgag200drmfb"); return drm_get_pci_dev(pdev, ent, &driver); } diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c index 780f983b0294..79d54103d470 100644 --- a/drivers/gpu/drm/mgag200/mgag200_main.c +++ b/drivers/gpu/drm/mgag200/mgag200_main.c @@ -124,20 +124,11 @@ static int mga_probe_vram(struct mga_device *mdev, void __iomem *mem) static int mga_vram_init(struct mga_device *mdev) { void __iomem *mem; - struct apertures_struct *aper = alloc_apertures(1); - if (!aper) - return -ENOMEM; /* BAR 0 is VRAM */ mdev->mc.vram_base = pci_resource_start(mdev->dev->pdev, 0); mdev->mc.vram_window = pci_resource_len(mdev->dev->pdev, 0); - aper->ranges[0].base = mdev->mc.vram_base; - aper->ranges[0].size = mdev->mc.vram_window; - - drm_fb_helper_remove_conflicting_framebuffers(aper, "mgafb", true); - kfree(aper); - if (!devm_request_mem_region(mdev->dev->dev, mdev->mc.vram_base, mdev->mc.vram_window, "mgadrmfb_vram")) { DRM_ERROR("can't reserve VRAM\n");