Merge tag 'devicetree-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree updates from Rob Herring: - Sync dtc with upstream version v1.4.6-21-g84e414b0b5bc. This adds new warnings which are either fixed or disabled by default (enabled with W=1). - Validate an untrusted offset in DT overlay function update_usages_of_a_phandle_reference - Fix a use after free error of_platform_device_destroy - Fix an off by 1 string errors in unittest - Avoid creating a struct device for OPP nodes - Update DT specific submitting-patches.txt with patch content and subject requirements. - Move some bindings to their proper subsystem locations - Add vendor prefixes for Kaohsiung, SiFive, Avnet, Wi2Wi, Logic PD, and ArcherMind - Add documentation for "no-gpio-delays" property in FSI bus GPIO master - Add compatible for r8a77990 SoC ravb ethernet block - More wack-a-mole removal of 'status' property in examples * tag 'devicetree-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (25 commits) dt-bindings: submitting-patches: add guidance on patch content and subject of: platform: stop accessing invalid dev in of_platform_device_destroy dt-bindings: net: ravb: Add support for r8a77990 SoC dt-bindings: Add vendor prefix for ArcherMind dt-bindings: fsi-master-gpio: Document "no-gpio-delays" property dt-bindings: Add vendor prefix for Logic PD of: overlay: validate offset from property fixups of: unittest: for strings, account for trailing \0 in property length field drm: rcar-du: disable dtc graph-endpoint warnings on DT overlays kbuild: disable new dtc graph and unit-address warnings scripts/dtc: Update to upstream version v1.4.6-21-g84e414b0b5bc MAINTAINERS: add keyword for devicetree overlay notifiers dt-bindings: define vendor prefix for Wi2Wi, Inc. dt-bindings: Add vendor prefix for Avnet, Inc. dt-bindings: Relocate Tegra20 memory controller bindings dt-bindings: Add "sifive" vendor prefix dt-bindings: exynos: move ADC binding to iio/adc/ directory dt-bindings: powerpc/4xx: move 4xx NDFC and EMAC bindings to subsystem directories dt-bindings: move various RNG bindings to rng/ directory dt-bindings: move various timer bindings to timer/ directory ...
This commit is contained in:
@ -177,7 +177,6 @@ int of_node_to_nid(struct device_node *device)
|
||||
|
||||
return NUMA_NO_NODE;
|
||||
}
|
||||
EXPORT_SYMBOL(of_node_to_nid);
|
||||
|
||||
int __init of_numa_init(void)
|
||||
{
|
||||
|
@ -32,6 +32,11 @@ const struct of_device_id of_default_bus_match_table[] = {
|
||||
{} /* Empty terminated list */
|
||||
};
|
||||
|
||||
static const struct of_device_id of_skipped_node_table[] = {
|
||||
{ .compatible = "operating-points-v2", },
|
||||
{} /* Empty terminated list */
|
||||
};
|
||||
|
||||
static int of_dev_node_match(struct device *dev, void *data)
|
||||
{
|
||||
return dev->of_node == data;
|
||||
@ -356,6 +361,12 @@ static int of_platform_bus_create(struct device_node *bus,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Skip nodes for which we don't want to create devices */
|
||||
if (unlikely(of_match_node(of_skipped_node_table, bus))) {
|
||||
pr_debug("%s() - skipping %pOF node\n", __func__, bus);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (of_node_check_flag(bus, OF_POPULATED_BUS)) {
|
||||
pr_debug("%s() - skipping %pOF, already populated\n",
|
||||
__func__, bus);
|
||||
@ -537,6 +548,9 @@ int of_platform_device_destroy(struct device *dev, void *data)
|
||||
if (of_node_check_flag(dev->of_node, OF_POPULATED_BUS))
|
||||
device_for_each_child(dev, NULL, of_platform_device_destroy);
|
||||
|
||||
of_node_clear_flag(dev->of_node, OF_POPULATED);
|
||||
of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
|
||||
|
||||
if (dev->bus == &platform_bus_type)
|
||||
platform_device_unregister(to_platform_device(dev));
|
||||
#ifdef CONFIG_ARM_AMBA
|
||||
@ -544,8 +558,6 @@ int of_platform_device_destroy(struct device *dev, void *data)
|
||||
amba_device_unregister(to_amba_device(dev));
|
||||
#endif
|
||||
|
||||
of_node_clear_flag(dev->of_node, OF_POPULATED);
|
||||
of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_platform_device_destroy);
|
||||
|
@ -122,6 +122,11 @@ static int update_usages_of_a_phandle_reference(struct device_node *overlay,
|
||||
goto err_fail;
|
||||
}
|
||||
|
||||
if (offset < 0 || offset + sizeof(__be32) > prop->length) {
|
||||
err = -EINVAL;
|
||||
goto err_fail;
|
||||
}
|
||||
|
||||
*(__be32 *)(prop->value + offset) = cpu_to_be32(phandle);
|
||||
}
|
||||
|
||||
|
@ -165,20 +165,20 @@ static void __init of_unittest_dynamic(void)
|
||||
/* Add a new property - should pass*/
|
||||
prop->name = "new-property";
|
||||
prop->value = "new-property-data";
|
||||
prop->length = strlen(prop->value);
|
||||
prop->length = strlen(prop->value) + 1;
|
||||
unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n");
|
||||
|
||||
/* Try to add an existing property - should fail */
|
||||
prop++;
|
||||
prop->name = "new-property";
|
||||
prop->value = "new-property-data-should-fail";
|
||||
prop->length = strlen(prop->value);
|
||||
prop->length = strlen(prop->value) + 1;
|
||||
unittest(of_add_property(np, prop) != 0,
|
||||
"Adding an existing property should have failed\n");
|
||||
|
||||
/* Try to modify an existing property - should pass */
|
||||
prop->value = "modify-property-data-should-pass";
|
||||
prop->length = strlen(prop->value);
|
||||
prop->length = strlen(prop->value) + 1;
|
||||
unittest(of_update_property(np, prop) == 0,
|
||||
"Updating an existing property should have passed\n");
|
||||
|
||||
@ -186,7 +186,7 @@ static void __init of_unittest_dynamic(void)
|
||||
prop++;
|
||||
prop->name = "modify-property";
|
||||
prop->value = "modify-missing-property-data-should-pass";
|
||||
prop->length = strlen(prop->value);
|
||||
prop->length = strlen(prop->value) + 1;
|
||||
unittest(of_update_property(np, prop) == 0,
|
||||
"Updating a missing property should have passed\n");
|
||||
|
||||
|
Reference in New Issue
Block a user