249 slot->sun = sun;
250 INIT_LIST_HEAD(&slot->funcs);
251 mutex_init(&slot->crit_sect);
252
253 slot->next = bridge->slots;
254 bridge->slots = slot;
255
256 bridge->nr_slots++;
257
258 dbg("found ACPI PCI Hotplug slot %llu at PCI %04x:%02x:%02x\n",
259 slot->sun, pci_domain_nr(bridge->pci_bus),
260 bridge->pci_bus->number, slot->device);
261 retval = acpiphp_register_hotplug_slot(slot);
262 if (retval) {
263 if (retval == -EBUSY)
264 warn("Slot %llu already registered by another "
265 "hotplug driver\n", slot->sun);
266 else
267 warn("acpiphp_register_hotplug_slot failed "
268 "(err code = 0x%x)\n", retval);
269 goto err_exit;
270 }
271 }
272
273 newfunc->slot = slot;
274 list_add_tail(&newfunc->sibling, &slot->funcs);
275
276
277 newfunc->pci_dev = pci_get_slot(bridge->pci_bus,
278 PCI_DEVFN(device, function));
279 if (newfunc->pci_dev) {
280 slot->flags |= (SLOT_ENABLED | SLOT_POWEREDON);
281 }
282
283 if (is_dock_device(handle)) {
284
285
286
287
288 newfunc->flags &= ~FUNC_HAS_EJ0;
289 if (register_hotplug_dock_device(handle,