From patchwork Mon Sep 28 19:51:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Gortmaker X-Patchwork-Id: 523580 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id EAD021401CD for ; Tue, 29 Sep 2015 05:52:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbbI1TwH (ORCPT ); Mon, 28 Sep 2015 15:52:07 -0400 Received: from mail.windriver.com ([147.11.1.11]:54948 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557AbbI1TwD (ORCPT ); Mon, 28 Sep 2015 15:52:03 -0400 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 t8SJq2uu010881 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 28 Sep 2015 12:52:02 -0700 (PDT) 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.235.1; Mon, 28 Sep 2015 12:52:01 -0700 From: Paul Gortmaker To: CC: Paul Gortmaker , "David S. Miller" , Subject: [PATCH 5/6] net/ethernet: make 8390/mac8390.c driver explicitly non-modular Date: Mon, 28 Sep 2015 15:51:29 -0400 Message-ID: <1443469890-19485-6-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.0.rc3 In-Reply-To: <1443469890-19485-1-git-send-email-paul.gortmaker@windriver.com> References: <1443469890-19485-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The Kconfig for this option is currently: config MAC8390 bool "Macintosh NS 8390 based ethernet cards" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned -- it was never even updated to use module_init/module_exit. After this, when reading the driver there should be no doubt it is builtin-only. We don't swap module.h for init.h since this file has init.h already. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We move the information from MODULE_AUTHOR to the comments at the top of the file for documentation purposes. Cc: "David S. Miller" Cc: netdev@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Signed-off-by: Paul Gortmaker --- drivers/net/ethernet/8390/mac8390.c | 40 ++----------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c index 65cf60f6718c..a971bf629715 100644 --- a/drivers/net/ethernet/8390/mac8390.c +++ b/drivers/net/ethernet/8390/mac8390.c @@ -4,6 +4,8 @@ taken from or inspired by skeleton.c by Donald Becker, acenic.c by Jes Sorensen, and ne2k-pci.c by Donald Becker and Paul Gortmaker. + Author: David Huggins-Daines and others. + This software may be used and distributed according to the terms of the GNU Public License, incorporated herein by reference. */ @@ -19,7 +21,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include #include #include @@ -449,43 +450,6 @@ out: return ERR_PTR(err); } -#ifdef MODULE -MODULE_AUTHOR("David Huggins-Daines and others"); -MODULE_DESCRIPTION("Macintosh NS8390-based Nubus Ethernet driver"); -MODULE_LICENSE("GPL"); - -/* overkill, of course */ -static struct net_device *dev_mac8390[15]; -int init_module(void) -{ - int i; - for (i = 0; i < 15; i++) { - struct net_device *dev = mac8390_probe(-1); - if (IS_ERR(dev)) - break; - dev_mac890[i] = dev; - } - if (!i) { - pr_notice("No useable cards found, driver NOT installed.\n"); - return -ENODEV; - } - return 0; -} - -void cleanup_module(void) -{ - int i; - for (i = 0; i < 15; i++) { - struct net_device *dev = dev_mac890[i]; - if (dev) { - unregister_netdev(dev); - free_netdev(dev); - } - } -} - -#endif /* MODULE */ - static const struct net_device_ops mac8390_netdev_ops = { .ndo_open = mac8390_open, .ndo_stop = mac8390_close,