xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kernel@vger.kernel.org
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	David Vrabel <david.vrabel@citrix.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: [PATCH v2 5/5] drivers/xen: make platform-pci.c explicitly non-modular
Date: Sun, 21 Feb 2016 19:06:08 -0500	[thread overview]
Message-ID: <1456099568-5154-6-git-send-email-paul.gortmaker__2975.02638209171$1456099693$gmane$org@windriver.com> (raw)
In-Reply-To: <1456099568-5154-1-git-send-email-paul.gortmaker@windriver.com>

The Kconfig currently controlling compilation of this code is:

arch/x86/xen/Kconfig:config XEN_PVHVM
arch/x86/xen/Kconfig:   def_bool y

...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.

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.

In removing "module" from the init fcn name, we observe a namespace
collision with the probe function, so we use "probe" in the name of
the probe function, and "init" in the registration fcn, as per
standard convention, as suggested by Stefano.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/xen/platform-pci.c | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
index 3454973dc3bb..cf9666680c8c 100644
--- a/drivers/xen/platform-pci.c
+++ b/drivers/xen/platform-pci.c
@@ -2,6 +2,9 @@
  * platform-pci.c
  *
  * Xen platform PCI device driver
+ *
+ * Authors: ssmith@xensource.com and stefano.stabellini@eu.citrix.com
+ *
  * Copyright (c) 2005, Intel Corporation.
  * Copyright (c) 2007, XenSource Inc.
  * Copyright (c) 2010, Citrix
@@ -24,7 +27,7 @@
 
 #include <linux/interrupt.h>
 #include <linux/io.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/pci.h>
 
 #include <xen/platform_pci.h>
@@ -36,10 +39,6 @@
 
 #define DRV_NAME    "xen-platform-pci"
 
-MODULE_AUTHOR("ssmith@xensource.com and stefano.stabellini@eu.citrix.com");
-MODULE_DESCRIPTION("Xen platform PCI device");
-MODULE_LICENSE("GPL");
-
 static unsigned long platform_mmio;
 static unsigned long platform_mmio_alloc;
 static unsigned long platform_mmiolen;
@@ -101,8 +100,8 @@ static int platform_pci_resume(struct pci_dev *pdev)
 	return 0;
 }
 
-static int platform_pci_init(struct pci_dev *pdev,
-			     const struct pci_device_id *ent)
+static int platform_pci_probe(struct pci_dev *pdev,
+			      const struct pci_device_id *ent)
 {
 	int i, ret;
 	long ioaddr;
@@ -181,20 +180,17 @@ static struct pci_device_id platform_pci_tbl[] = {
 	{0,}
 };
 
-MODULE_DEVICE_TABLE(pci, platform_pci_tbl);
-
 static struct pci_driver platform_driver = {
 	.name =           DRV_NAME,
-	.probe =          platform_pci_init,
+	.probe =          platform_pci_probe,
 	.id_table =       platform_pci_tbl,
 #ifdef CONFIG_PM
 	.resume_early =   platform_pci_resume,
 #endif
 };
 
-static int __init platform_pci_module_init(void)
+static int __init platform_pci_init(void)
 {
 	return pci_register_driver(&platform_driver);
 }
-
-module_init(platform_pci_module_init);
+device_initcall(platform_pci_init);
-- 
2.6.1

  parent reply	other threads:[~2016-02-22  0:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1456099568-5154-1-git-send-email-paul.gortmaker@windriver.com>
2016-02-22  0:06 ` [PATCH v2 1/5] xen: audit usages of module.h ; remove unnecessary instances Paul Gortmaker
2016-02-22  0:06 ` [PATCH v2 2/5] drivers/xen: make [xen-]ballon explicitly non-modular Paul Gortmaker
2016-02-22  0:06 ` [PATCH v2 3/5] drivers/xen: make xenbus_dev_[front/back]end " Paul Gortmaker
2016-02-22  0:06 ` [PATCH v2 4/5] drivers/xen: make sys-hypervisor.c " Paul Gortmaker
2016-02-22  0:06 ` Paul Gortmaker [this message]
     [not found] ` <1456099568-5154-5-git-send-email-paul.gortmaker@windriver.com>
2016-02-22 11:25   ` Stefano Stabellini
     [not found] ` <1456099568-5154-6-git-send-email-paul.gortmaker@windriver.com>
2016-02-22 11:27   ` [PATCH v2 5/5] drivers/xen: make platform-pci.c " Stefano Stabellini
2016-03-20  0:23 ` [PATCH v2 0/5] xen: avoid module usage in non-modular code Paul Gortmaker
     [not found] ` <20160320002321.GX23251@windriver.com>
2016-03-21 15:17   ` David Vrabel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='1456099568-5154-6-git-send-email-paul.gortmaker__2975.02638209171$1456099693$gmane$org@windriver.com' \
    --to=paul.gortmaker@windriver.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).