| .. | .. |
|---|
| 20 | 20 | #include <linux/of_iommu.h> |
|---|
| 21 | 21 | #include <linux/of_irq.h> |
|---|
| 22 | 22 | #include <linux/of_platform.h> |
|---|
| 23 | | -#include <linux/of_reserved_mem.h> |
|---|
| 24 | 23 | #include <linux/platform_device.h> |
|---|
| 25 | 24 | |
|---|
| 26 | 25 | const struct of_device_id of_default_bus_match_table[] = { |
|---|
| .. | .. |
|---|
| 38 | 37 | {} /* Empty terminated list */ |
|---|
| 39 | 38 | }; |
|---|
| 40 | 39 | |
|---|
| 41 | | -static int of_dev_node_match(struct device *dev, void *data) |
|---|
| 42 | | -{ |
|---|
| 43 | | - return dev->of_node == data; |
|---|
| 44 | | -} |
|---|
| 45 | | - |
|---|
| 46 | 40 | /** |
|---|
| 47 | 41 | * of_find_device_by_node - Find the platform_device associated with a node |
|---|
| 48 | 42 | * @np: Pointer to device tree node |
|---|
| .. | .. |
|---|
| 56 | 50 | { |
|---|
| 57 | 51 | struct device *dev; |
|---|
| 58 | 52 | |
|---|
| 59 | | - dev = bus_find_device(&platform_bus_type, NULL, np, of_dev_node_match); |
|---|
| 53 | + dev = bus_find_device_by_of_node(&platform_bus_type, np); |
|---|
| 60 | 54 | return dev ? to_platform_device(dev) : NULL; |
|---|
| 61 | 55 | } |
|---|
| 62 | 56 | EXPORT_SYMBOL(of_find_device_by_node); |
|---|
| .. | .. |
|---|
| 93 | 87 | reg = of_get_property(node, "reg", NULL); |
|---|
| 94 | 88 | if (reg && (addr = of_translate_address(node, reg)) != OF_BAD_ADDR) { |
|---|
| 95 | 89 | dev_set_name(dev, dev_name(dev) ? "%llx.%pOFn:%s" : "%llx.%pOFn", |
|---|
| 96 | | - (unsigned long long)addr, node, |
|---|
| 97 | | - dev_name(dev)); |
|---|
| 90 | + addr, node, dev_name(dev)); |
|---|
| 98 | 91 | return; |
|---|
| 99 | 92 | } |
|---|
| 100 | 93 | |
|---|
| .. | .. |
|---|
| 192 | 185 | dev->dev.bus = &platform_bus_type; |
|---|
| 193 | 186 | dev->dev.platform_data = platform_data; |
|---|
| 194 | 187 | of_msi_configure(&dev->dev, dev->dev.of_node); |
|---|
| 195 | | - of_reserved_mem_device_init_by_idx(&dev->dev, dev->dev.of_node, 0); |
|---|
| 196 | 188 | |
|---|
| 197 | 189 | if (of_device_add(dev) != 0) { |
|---|
| 198 | 190 | platform_device_put(dev); |
|---|
| .. | .. |
|---|
| 299 | 291 | #endif /* CONFIG_ARM_AMBA */ |
|---|
| 300 | 292 | |
|---|
| 301 | 293 | /** |
|---|
| 302 | | - * of_devname_lookup() - Given a device node, lookup the preferred Linux name |
|---|
| 294 | + * of_dev_lookup() - Given a device node, lookup the preferred Linux name |
|---|
| 303 | 295 | */ |
|---|
| 304 | 296 | static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *lookup, |
|---|
| 305 | 297 | struct device_node *np) |
|---|
| .. | .. |
|---|
| 546 | 538 | } |
|---|
| 547 | 539 | |
|---|
| 548 | 540 | /* Populate everything else. */ |
|---|
| 549 | | - fw_devlink_pause(); |
|---|
| 550 | 541 | of_platform_default_populate(NULL, NULL, NULL); |
|---|
| 551 | | - fw_devlink_resume(); |
|---|
| 552 | 542 | |
|---|
| 553 | 543 | return 0; |
|---|
| 554 | 544 | } |
|---|
| .. | .. |
|---|
| 598 | 588 | void of_platform_depopulate(struct device *parent) |
|---|
| 599 | 589 | { |
|---|
| 600 | 590 | if (parent->of_node && of_node_check_flag(parent->of_node, OF_POPULATED_BUS)) { |
|---|
| 601 | | - device_for_each_child(parent, NULL, of_platform_device_destroy); |
|---|
| 591 | + device_for_each_child_reverse(parent, NULL, of_platform_device_destroy); |
|---|
| 602 | 592 | of_node_clear_flag(parent->of_node, OF_POPULATED_BUS); |
|---|
| 603 | 593 | } |
|---|
| 604 | 594 | } |
|---|