From patchwork Mon Feb 22 03:13:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 8371181 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AD9C9F88A for ; Mon, 22 Feb 2016 03:14:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2373620306 for ; Mon, 22 Feb 2016 03:14:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D4982035D for ; Mon, 22 Feb 2016 03:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753288AbcBVDNi (ORCPT ); Sun, 21 Feb 2016 22:13:38 -0500 Received: from mail1.windriver.com ([147.11.146.13]:49130 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753276AbcBVDNh (ORCPT ); Sun, 21 Feb 2016 22:13:37 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u1M3DTD3025581 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 21 Feb 2016 19:13:29 -0800 (PST) Received: from yow-lpgnfs-02.corp.ad.wrs.com (128.224.149.8) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.248.2; Sun, 21 Feb 2016 19:13:29 -0800 From: Paul Gortmaker To: CC: Paul Gortmaker , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "David S. Miller" , , Subject: [PATCH 1/3] drivers/video: make fbdev/sunxvr500.c explicitly non-modular Date: Sun, 21 Feb 2016 22:13:10 -0500 Message-ID: <1456110792-21771-2-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1456110792-21771-1-git-send-email-paul.gortmaker@windriver.com> References: <1456110792-21771-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 The Kconfig currently controlling compilation of this code is: config FB_XVR500 bool "Sun XVR-500 3DLABS Wildcat support" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. We explicitly disallow a driver unbind, since that doesn't have a sensible use case anyway, and it allows us to drop the ".remove" code for non-modular drivers. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We don't replace module.h with init.h since the file already has that. We also delete the MODULE_LICENSE tag etc. since all that information was (or is now) contained at the top of the file in the comments. Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: "David S. Miller" Cc: sparclinux@vger.kernel.org Cc: linux-fbdev@vger.kernel.org Signed-off-by: Paul Gortmaker --- drivers/video/fbdev/sunxvr500.c | 42 +++++++---------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/drivers/video/fbdev/sunxvr500.c b/drivers/video/fbdev/sunxvr500.c index 387350d004df..dc0d886e4e7e 100644 --- a/drivers/video/fbdev/sunxvr500.c +++ b/drivers/video/fbdev/sunxvr500.c @@ -1,9 +1,10 @@ -/* sunxvr500.c: Sun 3DLABS XVR-500 Expert3D driver for sparc64 systems +/* sunxvr500.c: Sun 3DLABS XVR-500 Expert3D fb driver for sparc64 systems + * + * License: GPL * * Copyright (C) 2007 David S. Miller (davem@davemloft.net) */ -#include #include #include #include @@ -392,25 +393,6 @@ err_out: return err; } -static void e3d_pci_unregister(struct pci_dev *pdev) -{ - struct fb_info *info = pci_get_drvdata(pdev); - struct e3d_info *ep = info->par; - - unregister_framebuffer(info); - - iounmap(ep->ramdac); - iounmap(ep->fb_base); - - pci_release_region(pdev, 0); - pci_release_region(pdev, 1); - - fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); - - pci_disable_device(pdev); -} - static struct pci_device_id e3d_pci_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_3DLABS, 0x7a0), }, { PCI_DEVICE(0x1091, 0x7a0), }, @@ -434,10 +416,12 @@ static struct pci_device_id e3d_pci_table[] = { }; static struct pci_driver e3d_driver = { + .driver = { + .suppress_bind_attrs = true, + }, .name = "e3d", .id_table = e3d_pci_table, .probe = e3d_pci_register, - .remove = e3d_pci_unregister, }; static int __init e3d_init(void) @@ -447,16 +431,4 @@ static int __init e3d_init(void) return pci_register_driver(&e3d_driver); } - -static void __exit e3d_exit(void) -{ - pci_unregister_driver(&e3d_driver); -} - -module_init(e3d_init); -module_exit(e3d_exit); - -MODULE_DESCRIPTION("framebuffer driver for Sun XVR-500 graphics"); -MODULE_AUTHOR("David S. Miller "); -MODULE_VERSION("1.0"); -MODULE_LICENSE("GPL"); +device_initcall(e3d_init);