From patchwork Mon Feb 22 03:13:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 8371161 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 81ACDC0553 for ; Mon, 22 Feb 2016 03:14:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99F4220357 for ; Mon, 22 Feb 2016 03:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 943D820306 for ; Mon, 22 Feb 2016 03:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753050AbcBVDOD (ORCPT ); Sun, 21 Feb 2016 22:14:03 -0500 Received: from mail.windriver.com ([147.11.1.11]:36794 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292AbcBVDNj (ORCPT ); Sun, 21 Feb 2016 22:13:39 -0500 Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id u1M3DVio024112 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 21 Feb 2016 19:13:31 -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:31 -0800 From: Paul Gortmaker To: CC: Paul Gortmaker , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , "David S. Miller" , , Subject: [PATCH 2/3] drivers/video: make fbdev/sunxvr1000.c explicitly non-modular Date: Sun, 21 Feb 2016 22:13:11 -0500 Message-ID: <1456110792-21771-3-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_XVR1000 bool "Sun XVR-1000 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. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. 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. We don't replace module.h with init.h since the file already has that. Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. 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/sunxvr1000.c | 42 +++++++--------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/drivers/video/fbdev/sunxvr1000.c b/drivers/video/fbdev/sunxvr1000.c index 08879bdfad35..fb37f6e05391 100644 --- a/drivers/video/fbdev/sunxvr1000.c +++ b/drivers/video/fbdev/sunxvr1000.c @@ -1,9 +1,10 @@ -/* sunxvr1000.c: Sun XVR-1000 driver for sparc64 systems +/* sunxvr1000.c: Sun XVR-1000 fb driver for sparc64 systems + * + * License: GPL * * Copyright (C) 2010 David S. Miller (davem@davemloft.net) */ -#include #include #include #include @@ -173,36 +174,19 @@ err_out: return err; } -static int gfb_remove(struct platform_device *op) -{ - struct fb_info *info = dev_get_drvdata(&op->dev); - struct gfb_info *gp = info->par; - - unregister_framebuffer(info); - - iounmap(gp->fb_base); - - of_iounmap(&op->resource[6], gp->fb_base, gp->fb_size); - - framebuffer_release(info); - - return 0; -} - static const struct of_device_id gfb_match[] = { { .name = "SUNW,gfb", }, {}, }; -MODULE_DEVICE_TABLE(of, ffb_match); static struct platform_driver gfb_driver = { .probe = gfb_probe, - .remove = gfb_remove, .driver = { - .name = "gfb", - .of_match_table = gfb_match, + .name = "gfb", + .of_match_table = gfb_match, + .suppress_bind_attrs = true, }, }; @@ -213,16 +197,4 @@ static int __init gfb_init(void) return platform_driver_register(&gfb_driver); } - -static void __exit gfb_exit(void) -{ - platform_driver_unregister(&gfb_driver); -} - -module_init(gfb_init); -module_exit(gfb_exit); - -MODULE_DESCRIPTION("framebuffer driver for Sun XVR-1000 graphics"); -MODULE_AUTHOR("David S. Miller "); -MODULE_VERSION("1.0"); -MODULE_LICENSE("GPL"); +device_initcall(gfb_init);