[PATCH 08/15] PCI/acpiphp: Collapse the initialization call chain of"acpiphp" further

From: Myron Stowe
Date: Fri Dec 07 2012 - 01:25:36 EST


This patch collapses the initialization call chain of "acpiphp" by calling
acpi_pci_[un]register_driver() directly within acpiphp_{init,exit}(),
removing the intervening acpiphp_glue_{init,exit}() call.

No functional change.

Signed-off-by: Myron Stowe <myron.stowe@xxxxxxxxxx>
---

drivers/pci/hotplug/acpiphp.h | 2 --
drivers/pci/hotplug/acpiphp_core.c | 4 ++--
drivers/pci/hotplug/acpiphp_glue.c | 20 --------------------
3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 37f968e..bf62ac8 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -194,8 +194,6 @@ extern void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
extern struct acpi_pci_driver acpi_pci_hp_driver;
extern int acpiphp_add_bridge(struct acpi_pci_root *root);
extern void acpiphp_remove_bridge(struct acpi_pci_root *root);
-extern void acpiphp_glue_init(void);
-extern void acpiphp_glue_exit(void);
typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);

extern int acpiphp_enable_slot(struct acpiphp_slot *slot);
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 1f4e228..5536b42 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -357,7 +357,7 @@ static int __init acpiphp_init(void)

if (!acpi_pci_disabled)
/* initialize internal data structure etc. */
- acpiphp_glue_init();
+ acpi_pci_register_driver(&acpi_pci_hp_driver);

return 0;
}
@@ -367,7 +367,7 @@ static void __exit acpiphp_exit(void)
{
if (!acpi_pci_disabled)
/* deallocate internal data structures etc. */
- acpiphp_glue_exit();
+ acpi_pci_unregister_driver(&acpi_pci_hp_driver);
}

module_init(acpiphp_init);
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index f96b13c..3d5d7da 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -1413,26 +1413,6 @@ struct acpi_pci_driver acpi_pci_hp_driver = {
};

/**
- * acpiphp_glue_init - initializes all PCI hotplug - ACPI glue data structures
- */
-void __init acpiphp_glue_init(void)
-{
- acpi_pci_register_driver(&acpi_pci_hp_driver);
-}
-
-
-/**
- * acpiphp_glue_exit - terminates all PCI hotplug - ACPI glue data structures
- *
- * This function frees all data allocated in acpiphp_glue_init().
- */
-void acpiphp_glue_exit(void)
-{
- acpi_pci_unregister_driver(&acpi_pci_hp_driver);
-}
-
-
-/**
* acpiphp_enable_slot - power on slot
* @slot: ACPI PHP slot
*/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/