25 #include <linux/kernel.h>
26 #include <linux/module.h>
28 #include <linux/pci.h>
29 #include <linux/string.h>
30 #include <linux/slab.h>
36 static void rpaphp_release_slot(
struct hotplug_slot *hotplug_slot)
38 struct slot *
slot = (
struct slot *) hotplug_slot->private;
55 slot = kzalloc(
sizeof(
struct slot),
GFP_KERNEL);
69 slot->
index = drc_index;
87 static int is_registered(
struct slot *slot)
89 struct slot *tmp_slot;
103 dbg(
"%s - Entry: deregistering slot=%s\n",
104 __func__, slot->
name);
110 err(
"Problem unregistering a slot %s\n", slot->
name);
112 dbg(
"%s - Exit: rc[%d]\n", __func__, retval);
123 dbg(
"%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
124 __func__, slot->
dn->full_name, slot->
index, slot->
name,
128 if (is_registered(slot)) {
129 err(
"rpaphp_register_slot: slot[%s] is already registered\n", slot->
name);
134 slotno =
PCI_SLOT(PCI_DN(slot->
dn->child)->devfn);
139 err(
"pci_hp_register failed with error %d\n", retval);
145 info(
"Slot [%s] registered\n", slot->
name);