public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: <linux-kernel@vger.kernel.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>,
	Bjorn Helgaas <bhelgaas@google.com>, <linux-pci@vger.kernel.org>
Subject: [PATCH 2/9] PCI: PCIe pme: make it explicitly non-modular
Date: Wed, 24 Aug 2016 16:57:45 -0400	[thread overview]
Message-ID: <20160824205752.12024-3-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <20160824205752.12024-1-paul.gortmaker@windriver.com>

The Kconfig for this option is currently:

config PCIE_PME
        def_bool y
        depends on PCIEPORTBUS && PM

...where both dependencies are also bool items.  That means it currently
 is not being built as a module by anyone.  Lets remove all traces of
modularity, so that when reading the code, there is no doubt it is
builtin-only.

As part of that, we delete the .remove function, since that doesn't
seem to have a sensible use case.  With "normal" endpoint drivers,
we have in the past set the suppress_bind_attrs bit to make it clear
that the use of ".remove" in a built-in driver was deleted, but here
for PCI, it would seem to be overkill to jump through the
pcie_port_service_driver and into the struct device_driver in order
to finally try and do something similar with the bind setting.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't exchange module.h for init.h since this file already has it.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/pcie/pme.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 1ae4c73e7a3c..884bad5320f8 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -10,7 +10,6 @@
  * for more details.
  */
 
-#include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -449,17 +448,6 @@ static int pcie_pme_resume(struct pcie_device *srv)
 	return 0;
 }
 
-/**
- * pcie_pme_remove - Prepare PCIe PME service device for removal.
- * @srv - PCIe service device to remove.
- */
-static void pcie_pme_remove(struct pcie_device *srv)
-{
-	pcie_pme_suspend(srv);
-	free_irq(srv->irq, srv);
-	kfree(get_service_data(srv));
-}
-
 static struct pcie_port_service_driver pcie_pme_driver = {
 	.name		= "pcie_pme",
 	.port_type	= PCI_EXP_TYPE_ROOT_PORT,
@@ -468,7 +456,6 @@ static struct pcie_port_service_driver pcie_pme_driver = {
 	.probe		= pcie_pme_probe,
 	.suspend	= pcie_pme_suspend,
 	.resume		= pcie_pme_resume,
-	.remove		= pcie_pme_remove,
 };
 
 /**
@@ -478,5 +465,4 @@ static int __init pcie_pme_service_init(void)
 {
 	return pcie_port_service_register(&pcie_pme_driver);
 }
-
-module_init(pcie_pme_service_init);
+device_initcall(pcie_pme_service_init);
-- 
2.8.4

  parent reply	other threads:[~2016-08-24 21:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 20:57 [PATCH 0/9] PCI: final demodularization of non-modular code Paul Gortmaker
2016-08-24 20:57 ` [PATCH 1/9] PCI: PCIe dpc: make it explicitly non-modular Paul Gortmaker
2016-08-24 20:57 ` Paul Gortmaker [this message]
2016-08-24 20:57 ` [PATCH 3/9] PCI: PCIe aerdrv: " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 4/9] PCI: dra7xx: make host code " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 5/9] PCI: PCIe qcom: " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 6/9] PCI: PCIe xilinx: " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 7/9] PCI: PCIe xilinx-nwl: " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 8/9] PCI: hotplug_core: make it " Paul Gortmaker
2016-08-24 20:57 ` [PATCH 9/9] PCI: hotplug: make PCIe core code " Paul Gortmaker
2016-08-24 22:34 ` [PATCH 0/9] PCI: final demodularization of non-modular code Bjorn Helgaas

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=20160824205752.12024-3-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.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