Lines Matching refs:slot

38 	struct slot *slot = (struct slot *) hotplug_slot->private;  in rpaphp_release_slot()  local
39 dealloc_slot_struct(slot); in rpaphp_release_slot()
42 void dealloc_slot_struct(struct slot *slot) in dealloc_slot_struct() argument
44 kfree(slot->hotplug_slot->info); in dealloc_slot_struct()
45 kfree(slot->name); in dealloc_slot_struct()
46 kfree(slot->hotplug_slot); in dealloc_slot_struct()
47 kfree(slot); in dealloc_slot_struct()
50 struct slot *alloc_slot_struct(struct device_node *dn, in alloc_slot_struct()
53 struct slot *slot; in alloc_slot_struct() local
55 slot = kzalloc(sizeof(struct slot), GFP_KERNEL); in alloc_slot_struct()
56 if (!slot) in alloc_slot_struct()
58 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); in alloc_slot_struct()
59 if (!slot->hotplug_slot) in alloc_slot_struct()
61 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info), in alloc_slot_struct()
63 if (!slot->hotplug_slot->info) in alloc_slot_struct()
65 slot->name = kstrdup(drc_name, GFP_KERNEL); in alloc_slot_struct()
66 if (!slot->name) in alloc_slot_struct()
68 slot->dn = dn; in alloc_slot_struct()
69 slot->index = drc_index; in alloc_slot_struct()
70 slot->power_domain = power_domain; in alloc_slot_struct()
71 slot->hotplug_slot->private = slot; in alloc_slot_struct()
72 slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; in alloc_slot_struct()
73 slot->hotplug_slot->release = &rpaphp_release_slot; in alloc_slot_struct()
75 return (slot); in alloc_slot_struct()
78 kfree(slot->hotplug_slot->info); in alloc_slot_struct()
80 kfree(slot->hotplug_slot); in alloc_slot_struct()
82 kfree(slot); in alloc_slot_struct()
87 static int is_registered(struct slot *slot) in is_registered() argument
89 struct slot *tmp_slot; in is_registered()
92 if (!strcmp(tmp_slot->name, slot->name)) in is_registered()
98 int rpaphp_deregister_slot(struct slot *slot) in rpaphp_deregister_slot() argument
101 struct hotplug_slot *php_slot = slot->hotplug_slot; in rpaphp_deregister_slot()
104 __func__, slot->name); in rpaphp_deregister_slot()
106 list_del(&slot->rpaphp_slot_list); in rpaphp_deregister_slot()
110 err("Problem unregistering a slot %s\n", slot->name); in rpaphp_deregister_slot()
117 int rpaphp_register_slot(struct slot *slot) in rpaphp_register_slot() argument
119 struct hotplug_slot *php_slot = slot->hotplug_slot; in rpaphp_register_slot()
124 __func__, slot->dn->full_name, slot->index, slot->name, in rpaphp_register_slot()
125 slot->power_domain, slot->type); in rpaphp_register_slot()
128 if (is_registered(slot)) { in rpaphp_register_slot()
129 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); in rpaphp_register_slot()
133 if (slot->dn->child) in rpaphp_register_slot()
134 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); in rpaphp_register_slot()
137 retval = pci_hp_register(php_slot, slot->bus, slotno, slot->name); in rpaphp_register_slot()
144 list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); in rpaphp_register_slot()
145 info("Slot [%s] registered\n", slot->name); in rpaphp_register_slot()