Lines Matching refs:dn
30 static void pnv_php_register(struct device_node *dn);
31 static void pnv_php_unregister_one(struct device_node *dn);
32 static void pnv_php_unregister(struct device_node *dn);
87 static struct pnv_php_slot *pnv_php_match(struct device_node *dn, in pnv_php_match() argument
92 if (php_slot->dn == dn) { in pnv_php_match()
98 target = pnv_php_match(dn, tmp); in pnv_php_match()
106 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) in pnv_php_find_slot() argument
113 php_slot = pnv_php_match(dn, tmp); in pnv_php_find_slot()
129 static void pnv_php_rmv_pdns(struct device_node *dn) in pnv_php_rmv_pdns() argument
133 for_each_child_of_node(dn, child) { in pnv_php_rmv_pdns()
153 struct device_node *dn; in pnv_php_detach_device_nodes() local
156 for_each_child_of_node(parent, dn) { in pnv_php_detach_device_nodes()
157 pnv_php_detach_device_nodes(dn); in pnv_php_detach_device_nodes()
159 of_node_put(dn); in pnv_php_detach_device_nodes()
160 refcount = kref_read(&dn->kobj.kref); in pnv_php_detach_device_nodes()
163 refcount, dn); in pnv_php_detach_device_nodes()
165 of_detach_node(dn); in pnv_php_detach_device_nodes()
171 pnv_php_rmv_pdns(php_slot->dn); in pnv_php_rmv_devtree()
179 pnv_php_detach_device_nodes(php_slot->dn); in pnv_php_rmv_devtree()
185 php_slot->dn->child = NULL; in pnv_php_rmv_devtree()
216 struct device_node *dn) in pnv_php_populate_changeset() argument
221 for_each_child_of_node(dn, child) { in pnv_php_populate_changeset()
238 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data) in pnv_php_add_one_pdn() argument
243 pdn = pci_add_device_node_info(hose, dn); in pnv_php_add_one_pdn()
254 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose); in pnv_php_add_pdns()
272 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000); in pnv_php_add_devtree()
286 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL); in pnv_php_add_devtree()
295 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
296 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn); in pnv_php_add_devtree()
298 pnv_php_reverse_nodes(php_slot->dn); in pnv_php_add_devtree()
304 php_slot->dn->child = NULL; in pnv_php_add_devtree()
322 php_slot->dn->child = NULL; in pnv_php_add_devtree()
340 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle || in pnv_php_set_slot_power_state()
494 pnv_php_register(php_slot->dn); in pnv_php_enable()
524 pnv_php_unregister(php_slot->dn); in pnv_php_disable_slot()
555 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn) in pnv_php_alloc_slot() argument
563 ret = of_property_read_string(dn, "ibm,slot-label", &label); in pnv_php_alloc_slot()
567 if (pnv_pci_get_slot_id(dn, &id)) in pnv_php_alloc_slot()
570 bus = pci_find_bus_by_node(dn); in pnv_php_alloc_slot()
584 if (dn->child && PCI_DN(dn->child)) in pnv_php_alloc_slot()
585 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn); in pnv_php_alloc_slot()
591 php_slot->dn = dn; in pnv_php_alloc_slot()
609 struct device_node *dn = php_slot->dn; in pnv_php_register_slot() local
614 parent = pnv_php_find_slot(php_slot->dn); in pnv_php_register_slot()
629 while ((dn = of_get_parent(dn))) { in pnv_php_register_slot()
630 if (!PCI_DN(dn)) { in pnv_php_register_slot()
631 of_node_put(dn); in pnv_php_register_slot()
635 parent = pnv_php_find_slot(dn); in pnv_php_register_slot()
637 of_node_put(dn); in pnv_php_register_slot()
641 of_node_put(dn); in pnv_php_register_slot()
782 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc", in pnv_php_init_irq()
860 static int pnv_php_register_one(struct device_node *dn) in pnv_php_register_one() argument
867 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32); in pnv_php_register_one()
871 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32); in pnv_php_register_one()
875 php_slot = pnv_php_alloc_slot(dn); in pnv_php_register_one()
888 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32); in pnv_php_register_one()
895 pnv_php_unregister_one(php_slot->dn); in pnv_php_register_one()
901 static void pnv_php_register(struct device_node *dn) in pnv_php_register() argument
909 for_each_child_of_node(dn, child) { in pnv_php_register()
915 static void pnv_php_unregister_one(struct device_node *dn) in pnv_php_unregister_one() argument
919 php_slot = pnv_php_find_slot(dn); in pnv_php_unregister_one()
929 static void pnv_php_unregister(struct device_node *dn) in pnv_php_unregister() argument
934 for_each_child_of_node(dn, child) { in pnv_php_unregister()
942 struct device_node *dn; in pnv_php_init() local
945 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_init()
946 pnv_php_register(dn); in pnv_php_init()
953 struct device_node *dn; in pnv_php_exit() local
955 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb") in pnv_php_exit()
956 pnv_php_unregister(dn); in pnv_php_exit()