diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-09-14 22:19:53 -0500 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2021-09-14 22:19:53 -0500 |
commit | 7ca5eacb81ca9c851bc950346b87373ea53ffd2e (patch) | |
tree | 374790334ab1c22544e79ea0b8b2a6e173590d65 | |
parent | 8396415ca6b87964d565a0e608c5a86032a2830e (diff) |
Revert "of: property: fw_devlink: Add support for remote-endpoint"
This reverts commit f7514a6630166a7b566dee9b1af2e87e431959be.
-rw-r--r-- | drivers/of/property.c | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/drivers/of/property.c b/drivers/of/property.c index 3fd74bb34819..ac946525a8f3 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1056,25 +1056,6 @@ static bool of_is_ancestor_of(struct device_node *test_ancestor, return false; } -static struct device_node *of_get_compat_node(struct device_node *np) -{ - of_node_get(np); - - while (np) { - if (!of_device_is_available(np)) { - of_node_put(np); - np = NULL; - } - - if (of_find_property(np, "compatible", NULL)) - break; - - np = of_get_next_parent(np); - } - - return np; -} - /** * of_link_to_phandle - Add fwnode link to supplier from supplier phandle * @con_np: consumer device tree node @@ -1098,11 +1079,25 @@ static int of_link_to_phandle(struct device_node *con_np, struct device *sup_dev; struct device_node *tmp_np = sup_np; + of_node_get(sup_np); /* * Find the device node that contains the supplier phandle. It may be * @sup_np or it may be an ancestor of @sup_np. */ - sup_np = of_get_compat_node(sup_np); + while (sup_np) { + + /* Don't allow linking to a disabled supplier */ + if (!of_device_is_available(sup_np)) { + of_node_put(sup_np); + sup_np = NULL; + } + + if (of_find_property(sup_np, "compatible", NULL)) + break; + + sup_np = of_get_next_parent(sup_np); + } + if (!sup_np) { pr_debug("Not linking %pOFP to %pOFP - No device\n", con_np, tmp_np); @@ -1248,8 +1243,6 @@ static struct device_node *parse_##fname(struct device_node *np, \ * @parse_prop.prop_name: Name of property holding a phandle value * @parse_prop.index: For properties holding a list of phandles, this is the * index into the list - * @optional: Describes whether a supplier is mandatory or not - * @node_not_dev: The consumer node containing the property is never a device. * * Returns: * parse_prop() return values are @@ -1261,7 +1254,6 @@ struct supplier_bindings { struct device_node *(*parse_prop)(struct device_node *np, const char *prop_name, int index); bool optional; - bool node_not_dev; }; DEFINE_SIMPLE_PROP(clocks, "clocks", "#clock-cells") @@ -1375,12 +1367,6 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_pinctrl6, }, { .parse_prop = parse_pinctrl7, }, { .parse_prop = parse_pinctrl8, }, - { .parse_prop = parse_remote_endpoint, .node_not_dev = true, }, - { .parse_prop = parse_pwms, }, - { .parse_prop = parse_resets, }, - { .parse_prop = parse_leds, }, - { .parse_prop = parse_backlight, }, - { .parse_prop = parse_phy_handle, }, { .parse_prop = parse_gpio_compat, }, { .parse_prop = parse_interrupts, }, { .parse_prop = parse_regulators, }, @@ -1423,16 +1409,10 @@ static int of_link_property(struct device_node *con_np, const char *prop_name) } while ((phandle = s->parse_prop(con_np, prop_name, i))) { - struct device_node *con_dev_np; - - con_dev_np = s->node_not_dev - ? of_get_compat_node(con_np) - : of_node_get(con_np); matched = true; i++; - of_link_to_phandle(con_dev_np, phandle); + of_link_to_phandle(con_np, phandle); of_node_put(phandle); - of_node_put(con_dev_np); } s++; } |