Lines Matching refs:bridge

36  *    when the bridge is scanned and it loses a refcount when the bridge
38 * - When a P2P bridge is present, we elevate the refcount on the subordinate
119 WARN_ON(context->bridge);
124 static inline void get_bridge(struct acpiphp_bridge *bridge)
126 kref_get(&bridge->ref);
129 static inline void put_bridge(struct acpiphp_bridge *bridge)
131 kref_put(&bridge->ref, free_bridge);
158 struct acpiphp_bridge *bridge;
164 bridge = container_of(kref, struct acpiphp_bridge, ref);
166 list_for_each_entry_safe(slot, next, &bridge->slots, node) {
173 context = bridge->context;
178 context->bridge = NULL;
182 put_device(&bridge->pci_bus->dev);
183 pci_dev_put(bridge->pci_dev);
184 kfree(bridge);
209 * secondary bridge on slot
258 * @data: The object's parent ACPIPHP bridge.
264 struct acpiphp_bridge *bridge = data;
272 struct pci_bus *pbus = bridge->pci_bus;
273 struct pci_dev *pdev = bridge->pci_dev;
298 newfunc->parent = bridge;
312 list_for_each_entry(slot, &bridge->slots, node)
324 slot->bus = bridge->pci_bus;
328 list_add_tail(&slot->node, &bridge->slots);
341 bridge->nr_slots++;
344 sun = bridge->nr_slots;
352 bridge->nr_slots--;
372 static void cleanup_bridge(struct acpiphp_bridge *bridge)
377 list_for_each_entry(slot, &bridge->slots, node) {
392 list_del(&bridge->list);
396 bridge->is_going_away = true;
655 /* The device is a bridge. so check the bus below it. */
666 * @bridge: where to begin re-enumeration
668 * Iterate over all slots under this bridge and make sure that if a
671 static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
675 /* Bail out if the bridge is going away. */
676 if (bridge->is_going_away)
679 list_for_each_entry(slot, &bridge->slots, node) {
730 struct acpiphp_bridge *bridge = NULL;
734 bridge = to_acpiphp_root_context(adev->hp)->root_bridge;
735 if (bridge)
736 get_bridge(bridge);
739 if (bridge) {
742 acpiphp_check_bridge(bridge);
745 put_bridge(bridge);
756 struct acpiphp_bridge *bridge;
759 bridge = context->bridge;
760 if (bridge)
761 get_bridge(bridge);
771 if (bridge)
772 acpiphp_check_bridge(bridge);
781 if (bridge) {
782 acpiphp_check_bridge(bridge);
801 if (bridge)
802 put_bridge(bridge);
827 struct acpiphp_bridge *bridge;
835 adev = ACPI_COMPANION(bus->bridge);
840 bridge = kzalloc(sizeof(struct acpiphp_bridge), GFP_KERNEL);
841 if (!bridge) {
842 acpi_handle_err(handle, "No memory for bridge object\n");
846 INIT_LIST_HEAD(&bridge->slots);
847 kref_init(&bridge->ref);
848 bridge->pci_dev = pci_dev_get(bus->self);
849 bridge->pci_bus = bus;
859 if (pci_is_root_bus(bridge->pci_bus)) {
866 root_context->root_bridge = bridge;
872 * This bridge should have been registered as a hotplug function
875 * bridge is not interesting to us either.
881 bridge->context = context;
882 context->bridge = bridge;
883 /* Get a reference to the parent bridge. */
890 list_add(&bridge->list, &bridge_list);
893 /* register all slot objects under this bridge */
895 acpiphp_add_context, NULL, bridge, NULL);
898 cleanup_bridge(bridge);
899 put_bridge(bridge);
906 pci_dev_put(bridge->pci_dev);
907 kfree(bridge);
910 static void acpiphp_drop_bridge(struct acpiphp_bridge *bridge)
912 if (pci_is_root_bus(bridge->pci_bus)) {
917 adev = ACPI_COMPANION(bridge->pci_bus->bridge);
923 cleanup_bridge(bridge);
924 put_bridge(bridge);
933 struct acpiphp_bridge *bridge;
939 list_for_each_entry(bridge, &bridge_list, list)
940 if (bridge->pci_bus == bus) {
942 acpiphp_drop_bridge(bridge);