Lines Matching refs:np

152 static void pci_pwrctrl_power_off_device(struct device_node *np)  in pci_pwrctrl_power_off_device()  argument
157 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_power_off_device()
160 pdev = of_find_device_by_node(np); in pci_pwrctrl_power_off_device()
184 struct device_node *np = parent->of_node; in pci_pwrctrl_power_off_devices() local
186 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_power_off_devices()
205 static int pci_pwrctrl_power_on_device(struct device_node *np) in pci_pwrctrl_power_on_device() argument
210 for_each_available_child_of_node_scoped(np, child) { in pci_pwrctrl_power_on_device()
216 pdev = of_find_device_by_node(np); in pci_pwrctrl_power_on_device()
247 struct device_node *np = parent->of_node; in pci_pwrctrl_power_on_devices() local
251 for_each_available_child_of_node(np, child) { in pci_pwrctrl_power_on_devices()
260 for_each_available_child_of_node_scoped(np, tmp) { in pci_pwrctrl_power_on_devices()
281 static bool pci_pwrctrl_is_required(struct device_node *np) in pci_pwrctrl_is_required() argument
287 ret = of_property_read_string(np, "compatible", &compat); in pci_pwrctrl_is_required()
294 if (of_pci_supply_present(np)) in pci_pwrctrl_is_required()
297 if (of_graph_is_present(np)) { in pci_pwrctrl_is_required()
298 for_each_endpoint_of_node(np, endpoint) { in pci_pwrctrl_is_required()
313 static int pci_pwrctrl_create_device(struct device_node *np, in pci_pwrctrl_create_device() argument
319 for_each_available_child_of_node_scoped(np, child) { in pci_pwrctrl_create_device()
326 pdev = of_find_device_by_node(np); in pci_pwrctrl_create_device()
332 if (!pci_pwrctrl_is_required(np)) { in pci_pwrctrl_create_device()
333 dev_dbg(parent, "Skipping OF node: %s\n", np->name); in pci_pwrctrl_create_device()
338 pdev = of_platform_device_create(np, NULL, parent); in pci_pwrctrl_create_device()
340 dev_err(parent, "Failed to create pwrctrl device for node: %s\n", np->name); in pci_pwrctrl_create_device()
374 static void pci_pwrctrl_destroy_device(struct device_node *np) in pci_pwrctrl_destroy_device() argument
378 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_destroy_device()
381 pdev = of_find_device_by_node(np); in pci_pwrctrl_destroy_device()
388 of_node_clear_flag(np, OF_POPULATED); in pci_pwrctrl_destroy_device()
401 struct device_node *np = parent->of_node; in pci_pwrctrl_destroy_devices() local
403 for_each_available_child_of_node_scoped(np, child) in pci_pwrctrl_destroy_devices()