hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/of/platform.c
....@@ -20,7 +20,6 @@
2020 #include <linux/of_iommu.h>
2121 #include <linux/of_irq.h>
2222 #include <linux/of_platform.h>
23
-#include <linux/of_reserved_mem.h>
2423 #include <linux/platform_device.h>
2524
2625 const struct of_device_id of_default_bus_match_table[] = {
....@@ -38,11 +37,6 @@
3837 {} /* Empty terminated list */
3938 };
4039
41
-static int of_dev_node_match(struct device *dev, void *data)
42
-{
43
- return dev->of_node == data;
44
-}
45
-
4640 /**
4741 * of_find_device_by_node - Find the platform_device associated with a node
4842 * @np: Pointer to device tree node
....@@ -56,7 +50,7 @@
5650 {
5751 struct device *dev;
5852
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);
6054 return dev ? to_platform_device(dev) : NULL;
6155 }
6256 EXPORT_SYMBOL(of_find_device_by_node);
....@@ -93,8 +87,7 @@
9387 reg = of_get_property(node, "reg", NULL);
9488 if (reg && (addr = of_translate_address(node, reg)) != OF_BAD_ADDR) {
9589 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));
9891 return;
9992 }
10093
....@@ -192,7 +185,6 @@
192185 dev->dev.bus = &platform_bus_type;
193186 dev->dev.platform_data = platform_data;
194187 of_msi_configure(&dev->dev, dev->dev.of_node);
195
- of_reserved_mem_device_init_by_idx(&dev->dev, dev->dev.of_node, 0);
196188
197189 if (of_device_add(dev) != 0) {
198190 platform_device_put(dev);
....@@ -299,7 +291,7 @@
299291 #endif /* CONFIG_ARM_AMBA */
300292
301293 /**
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
303295 */
304296 static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *lookup,
305297 struct device_node *np)
....@@ -546,9 +538,7 @@
546538 }
547539
548540 /* Populate everything else. */
549
- fw_devlink_pause();
550541 of_platform_default_populate(NULL, NULL, NULL);
551
- fw_devlink_resume();
552542
553543 return 0;
554544 }
....@@ -598,7 +588,7 @@
598588 void of_platform_depopulate(struct device *parent)
599589 {
600590 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);
602592 of_node_clear_flag(parent->of_node, OF_POPULATED_BUS);
603593 }
604594 }