Lines Matching refs:slot

22 void dealloc_slot_struct(struct slot *slot)  in dealloc_slot_struct()  argument
24 kfree(slot->hotplug_slot->info); in dealloc_slot_struct()
25 kfree(slot->name); in dealloc_slot_struct()
26 kfree(slot->hotplug_slot); in dealloc_slot_struct()
27 kfree(slot); in dealloc_slot_struct()
30 struct slot *alloc_slot_struct(struct device_node *dn, in alloc_slot_struct()
33 struct slot *slot; in alloc_slot_struct() local
35 slot = kzalloc(sizeof(struct slot), GFP_KERNEL); in alloc_slot_struct()
36 if (!slot) in alloc_slot_struct()
38 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); in alloc_slot_struct()
39 if (!slot->hotplug_slot) in alloc_slot_struct()
41 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info), in alloc_slot_struct()
43 if (!slot->hotplug_slot->info) in alloc_slot_struct()
45 slot->name = kstrdup(drc_name, GFP_KERNEL); in alloc_slot_struct()
46 if (!slot->name) in alloc_slot_struct()
48 slot->dn = dn; in alloc_slot_struct()
49 slot->index = drc_index; in alloc_slot_struct()
50 slot->power_domain = power_domain; in alloc_slot_struct()
51 slot->hotplug_slot->private = slot; in alloc_slot_struct()
52 slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; in alloc_slot_struct()
54 return (slot); in alloc_slot_struct()
57 kfree(slot->hotplug_slot->info); in alloc_slot_struct()
59 kfree(slot->hotplug_slot); in alloc_slot_struct()
61 kfree(slot); in alloc_slot_struct()
66 static int is_registered(struct slot *slot) in is_registered() argument
68 struct slot *tmp_slot; in is_registered()
71 if (!strcmp(tmp_slot->name, slot->name)) in is_registered()
77 int rpaphp_deregister_slot(struct slot *slot) in rpaphp_deregister_slot() argument
80 struct hotplug_slot *php_slot = slot->hotplug_slot; in rpaphp_deregister_slot()
83 __func__, slot->name); in rpaphp_deregister_slot()
85 list_del(&slot->rpaphp_slot_list); in rpaphp_deregister_slot()
87 dealloc_slot_struct(slot); in rpaphp_deregister_slot()
94 int rpaphp_register_slot(struct slot *slot) in rpaphp_register_slot() argument
96 struct hotplug_slot *php_slot = slot->hotplug_slot; in rpaphp_register_slot()
103 __func__, slot->dn, slot->index, slot->name, in rpaphp_register_slot()
104 slot->power_domain, slot->type); in rpaphp_register_slot()
107 if (is_registered(slot)) { in rpaphp_register_slot()
108 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); in rpaphp_register_slot()
112 for_each_child_of_node(slot->dn, child) { in rpaphp_register_slot()
114 if (my_index == slot->index) { in rpaphp_register_slot()
121 retval = pci_hp_register(php_slot, slot->bus, slotno, slot->name); in rpaphp_register_slot()
128 list_add(&slot->rpaphp_slot_list, &rpaphp_slot_head); in rpaphp_register_slot()
129 info("Slot [%s] registered\n", slot->name); in rpaphp_register_slot()