Lines Matching +full:device +full:- +full:handle

1 // SPDX-License-Identifier: GPL-2.0-only
3 * pci_slot.c - ACPI PCI Slot Driver
10 * Copyright (C) 2007-2008 Hewlett-Packard Development Company, L.P.
27 #include <linux/pci-acpi.h>
42 check_slot(acpi_handle handle, unsigned long long *sun) in check_slot() argument
44 int device = -1; in check_slot() local
49 acpi_get_name(handle, ACPI_FULL_PATHNAME, &buffer); in check_slot()
54 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); in check_slot()
59 status = acpi_evaluate_integer(handle, "_ADR", NULL, &adr); in check_slot()
67 status = acpi_evaluate_integer(handle, "_SUN", NULL, sun); in check_slot()
74 device = (adr >> 16) & 0xffff; in check_slot()
77 return device; in check_slot()
81 * Check whether handle has an associated slot and create PCI slot if it has.
84 register_slot(acpi_handle handle, u32 lvl, void *context, void **rv) in register_slot() argument
86 int device; in register_slot() local
93 device = check_slot(handle, &sun); in register_slot()
94 if (device < 0) in register_slot()
99 * Check whether PCI slot has already been created for this PCI device. in register_slot()
102 pci_slot = slot->pci_slot; in register_slot()
103 if (pci_slot->bus == pci_bus && pci_slot->number == device) in register_slot()
112 pci_slot = pci_create_slot(pci_bus, device, name, NULL); in register_slot()
119 slot->pci_slot = pci_slot; in register_slot()
120 list_add(&slot->list, &slot_list); in register_slot()
122 get_device(&pci_bus->dev); in register_slot()
124 pr_debug("%p, pci_bus: %x, device: %d, name: %s\n", in register_slot()
125 pci_slot, pci_bus->number, device, name); in register_slot()
132 acpi_handle handle = ACPI_HANDLE(bus->bridge); in acpi_pci_slot_enumerate() local
134 if (handle) { in acpi_pci_slot_enumerate()
136 acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, 1, in acpi_pci_slot_enumerate()
148 if (slot->pci_slot->bus == bus) { in acpi_pci_slot_remove()
149 list_del(&slot->list); in acpi_pci_slot_remove()
150 pci_destroy_slot(slot->pci_slot); in acpi_pci_slot_remove()
151 put_device(&bus->dev); in acpi_pci_slot_remove()
161 d->ident); in do_sta_before_sun()