Lines Matching refs:bridge

105 	WARN_ON(context->bridge);  in acpiphp_put_context()
110 static inline void get_bridge(struct acpiphp_bridge *bridge) in get_bridge() argument
112 kref_get(&bridge->ref); in get_bridge()
115 static inline void put_bridge(struct acpiphp_bridge *bridge) in put_bridge() argument
117 kref_put(&bridge->ref, free_bridge); in put_bridge()
152 struct acpiphp_bridge *bridge; in free_bridge() local
158 bridge = container_of(kref, struct acpiphp_bridge, ref); in free_bridge()
160 list_for_each_entry_safe(slot, next, &bridge->slots, node) { in free_bridge()
167 context = bridge->context; in free_bridge()
172 context->bridge = NULL; in free_bridge()
176 put_device(&bridge->pci_bus->dev); in free_bridge()
177 pci_dev_put(bridge->pci_dev); in free_bridge()
178 kfree(bridge); in free_bridge()
230 struct acpiphp_bridge *bridge = data; in acpiphp_add_context() local
237 struct pci_bus *pbus = bridge->pci_bus; in acpiphp_add_context()
238 struct pci_dev *pdev = bridge->pci_dev; in acpiphp_add_context()
264 newfunc->parent = bridge; in acpiphp_add_context()
278 list_for_each_entry(slot, &bridge->slots, node) in acpiphp_add_context()
290 slot->bus = bridge->pci_bus; in acpiphp_add_context()
294 list_add_tail(&slot->node, &bridge->slots); in acpiphp_add_context()
308 bridge->nr_slots++; in acpiphp_add_context()
311 sun = bridge->nr_slots; in acpiphp_add_context()
319 bridge->nr_slots--; in acpiphp_add_context()
339 static void cleanup_bridge(struct acpiphp_bridge *bridge) in cleanup_bridge() argument
344 list_for_each_entry(slot, &bridge->slots, node) { in cleanup_bridge()
359 list_del(&bridge->list); in cleanup_bridge()
363 bridge->is_going_away = true; in cleanup_bridge()
444 static void acpiphp_native_scan_bridge(struct pci_dev *bridge) in acpiphp_native_scan_bridge() argument
446 struct pci_bus *bus = bridge->subordinate; in acpiphp_native_scan_bridge()
482 static void enable_slot(struct acpiphp_slot *slot, bool bridge) in enable_slot() argument
488 if (bridge && bus->self && hotplug_is_native(bus->self)) { in enable_slot()
697 static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) in acpiphp_check_bridge() argument
702 if (bridge->is_going_away) in acpiphp_check_bridge()
705 if (bridge->pci_dev) in acpiphp_check_bridge()
706 pm_runtime_get_sync(&bridge->pci_dev->dev); in acpiphp_check_bridge()
708 list_for_each_entry(slot, &bridge->slots, node) { in acpiphp_check_bridge()
728 if (bridge->pci_dev) in acpiphp_check_bridge()
729 pm_runtime_put(&bridge->pci_dev->dev); in acpiphp_check_bridge()
762 struct acpiphp_bridge *bridge = NULL; in acpiphp_check_host_bridge() local
766 bridge = to_acpiphp_root_context(adev->hp)->root_bridge; in acpiphp_check_host_bridge()
767 if (bridge) in acpiphp_check_host_bridge()
768 get_bridge(bridge); in acpiphp_check_host_bridge()
771 if (bridge) { in acpiphp_check_host_bridge()
774 acpiphp_check_bridge(bridge); in acpiphp_check_host_bridge()
777 put_bridge(bridge); in acpiphp_check_host_bridge()
788 struct acpiphp_bridge *bridge; in hotplug_event() local
791 bridge = context->bridge; in hotplug_event()
792 if (bridge) in hotplug_event()
793 get_bridge(bridge); in hotplug_event()
803 if (bridge) in hotplug_event()
804 acpiphp_check_bridge(bridge); in hotplug_event()
813 if (bridge) { in hotplug_event()
814 acpiphp_check_bridge(bridge); in hotplug_event()
833 if (bridge) in hotplug_event()
834 put_bridge(bridge); in hotplug_event()
859 struct acpiphp_bridge *bridge; in acpiphp_enumerate_slots() local
867 adev = ACPI_COMPANION(bus->bridge); in acpiphp_enumerate_slots()
872 bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL); in acpiphp_enumerate_slots()
873 if (!bridge) in acpiphp_enumerate_slots()
876 INIT_LIST_HEAD(&bridge->slots); in acpiphp_enumerate_slots()
877 kref_init(&bridge->ref); in acpiphp_enumerate_slots()
878 bridge->pci_dev = pci_dev_get(bus->self); in acpiphp_enumerate_slots()
879 bridge->pci_bus = bus; in acpiphp_enumerate_slots()
889 if (pci_is_root_bus(bridge->pci_bus)) { in acpiphp_enumerate_slots()
896 root_context->root_bridge = bridge; in acpiphp_enumerate_slots()
911 bridge->context = context; in acpiphp_enumerate_slots()
912 context->bridge = bridge; in acpiphp_enumerate_slots()
920 list_add(&bridge->list, &bridge_list); in acpiphp_enumerate_slots()
925 acpiphp_add_context, NULL, bridge, NULL); in acpiphp_enumerate_slots()
928 cleanup_bridge(bridge); in acpiphp_enumerate_slots()
929 put_bridge(bridge); in acpiphp_enumerate_slots()
936 pci_dev_put(bridge->pci_dev); in acpiphp_enumerate_slots()
937 kfree(bridge); in acpiphp_enumerate_slots()
940 static void acpiphp_drop_bridge(struct acpiphp_bridge *bridge) in acpiphp_drop_bridge() argument
942 if (pci_is_root_bus(bridge->pci_bus)) { in acpiphp_drop_bridge()
947 adev = ACPI_COMPANION(bridge->pci_bus->bridge); in acpiphp_drop_bridge()
953 cleanup_bridge(bridge); in acpiphp_drop_bridge()
954 put_bridge(bridge); in acpiphp_drop_bridge()
963 struct acpiphp_bridge *bridge; in acpiphp_remove_slots() local
969 list_for_each_entry(bridge, &bridge_list, list) in acpiphp_remove_slots()
970 if (bridge->pci_bus == bus) { in acpiphp_remove_slots()
972 acpiphp_drop_bridge(bridge); in acpiphp_remove_slots()