Pull acpi_device_handle_cleanup into release branch
[sfrench/cifs-2.6.git] / drivers / pci / hotplug / rpaphp_core.c
index 341fdd59090b8af03fbbbc313e3aba6311d7c6f8..076bd6dcafae6ffa588898f2930f47c3f9833a10 100644 (file)
@@ -22,7 +22,6 @@
  * Send feedback to <lxie@us.ibm.com>
  *
  */
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
@@ -56,25 +55,6 @@ MODULE_LICENSE("GPL");
 
 module_param(debug, bool, 0644);
 
-static int enable_slot(struct hotplug_slot *slot);
-static int disable_slot(struct hotplug_slot *slot);
-static int set_attention_status(struct hotplug_slot *slot, u8 value);
-static int get_power_status(struct hotplug_slot *slot, u8 * value);
-static int get_attention_status(struct hotplug_slot *slot, u8 * value);
-static int get_adapter_status(struct hotplug_slot *slot, u8 * value);
-static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_speed *value);
-
-struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
-       .owner = THIS_MODULE,
-       .enable_slot = enable_slot,
-       .disable_slot = disable_slot,
-       .set_attention_status = set_attention_status,
-       .get_power_status = get_power_status,
-       .get_attention_status = get_attention_status,
-       .get_adapter_status = get_adapter_status,
-       .get_max_bus_speed = get_max_bus_speed,
-};
-
 static int rpaphp_get_attention_status(struct slot *slot)
 {
        return slot->hotplug_slot->info->attention_status;
@@ -196,11 +176,6 @@ static int get_max_bus_speed(struct hotplug_slot *hotplug_slot, enum pci_bus_spe
        return 0;
 }
 
-int rpaphp_remove_slot(struct slot *slot)
-{
-       return deregister_slot(slot);
-}
-
 static int get_children_props(struct device_node *dn, int **drc_indexes,
                int **drc_names, int **drc_types, int **drc_power_domains)
 {
@@ -307,13 +282,15 @@ static int is_php_dn(struct device_node *dn, int **indexes, int **names,
        return 0;
 }
 
-/****************************************************************
+/**
+ * rpaphp_add_slot -- add hotplug or dlpar slot
+ *
  *     rpaphp not only registers PCI hotplug slots(HOTPLUG), 
  *     but also logical DR slots(EMBEDDED).
  *     HOTPLUG slot: An adapter can be physically added/removed. 
  *     EMBEDDED slot: An adapter can be logically removed/added
  *               from/to a partition with the slot.
- ***************************************************************/
+ */
 int rpaphp_add_slot(struct device_node *dn)
 {
        struct slot *slot;
@@ -344,7 +321,7 @@ int rpaphp_add_slot(struct device_node *dn)
                        dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
                                        indexes[i + 1], name, type);
 
-                       retval = register_pci_slot(slot);
+                       retval = rpaphp_register_pci_slot(slot);
                }
        }
 exit:
@@ -382,9 +359,6 @@ static int __init rpaphp_init(void)
        while ((dn = of_find_node_by_type(dn, "pci")))
                rpaphp_add_slot(dn);
 
-       if (!num_slots)
-               return -ENODEV;
-
        return 0;
 }
 
@@ -458,10 +432,20 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
        return retval;
 }
 
+struct hotplug_slot_ops rpaphp_hotplug_slot_ops = {
+       .owner = THIS_MODULE,
+       .enable_slot = enable_slot,
+       .disable_slot = disable_slot,
+       .set_attention_status = set_attention_status,
+       .get_power_status = get_power_status,
+       .get_attention_status = get_attention_status,
+       .get_adapter_status = get_adapter_status,
+       .get_max_bus_speed = get_max_bus_speed,
+};
+
 module_init(rpaphp_init);
 module_exit(rpaphp_exit);
 
 EXPORT_SYMBOL_GPL(rpaphp_add_slot);
-EXPORT_SYMBOL_GPL(rpaphp_remove_slot);
 EXPORT_SYMBOL_GPL(rpaphp_slot_head);
 EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);