diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-04 20:11:25 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-06-04 20:11:25 -0700 |
commit | 571d54ed91c0fae174d933683c0c2e11c84843d9 (patch) | |
tree | fedc4c05816f9adff472889fca5ba13039683121 /drivers/of | |
parent | 9d71d3cd9ef040c284506648285915e9ba4d08c4 (diff) | |
parent | 8211d1e83aded34631aa87fa37f97d7bb712e925 (diff) |
Merge tag 'devicetree-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring:
- Convert various DT (non-binding) doc files to ReST
- Various improvements to device link code
- Fix __of_attach_node_sysfs refcounting bug
- Add support for 'memory-region-names' with reserved-memory binding
- Vendor prefixes for Protonic Holland, BeagleBoard.org, Alps, Check
Point, Würth Elektronik, U-Boot, Vaisala, Baikal Electronics,
Shanghai Awinic Technology Co., MikroTik, Silex Insight
- A bunch more binding conversions to DT schema. Only 3K to go.
- Add a minimum version check for schema tools
- Treewide dropping of 'allOf' usage with schema references. Not needed
in new json-schema spec.
- Some formatting clean-ups of schemas
* tag 'devicetree-for-5.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (194 commits)
dt-bindings: clock: Add documentation for X1830 bindings.
dt-bindings: mailbox: Convert imx mu to json-schema
dt-bindings: power: Convert imx gpcv2 to json-schema
dt-bindings: power: Convert imx gpc to json-schema
dt-bindings: Merge gpio-usb-b-connector with usb-connector
dt-bindings: timer: renesas: cmt: Convert to json-schema
dt-bindings: clock: Convert i.MX8QXP LPCG to json-schema
dt-bindings: timer: Convert i.MX GPT to json-schema
dt-bindings: thermal: rcar-thermal: Add device tree support for r8a7742
dt-bindings: serial: Add binding for UART pin swap
dt-bindings: geni-se: Add interconnect binding for GENI QUP
dt-bindings: geni-se: Convert QUP geni-se bindings to YAML
dt-bindings: vendor-prefixes: Add Silex Insight vendor prefix
dt-bindings: input: touchscreen: edt-ft5x06: change reg property
dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver
dt-bindings: timer: renesas: mtu2: Convert to json-schema
of/fdt: Remove redundant kbasename function call
dt-bindings: clock: Convert i.MX1 clock to json-schema
dt-bindings: clock: Convert i.MX21 clock to json-schema
dt-bindings: clock: Convert i.MX25 clock to json-schema
...
Diffstat (limited to 'drivers/of')
-rw-r--r-- | drivers/of/dynamic.c | 3 | ||||
-rw-r--r-- | drivers/of/fdt.c | 8 | ||||
-rw-r--r-- | drivers/of/kobj.c | 3 | ||||
-rw-r--r-- | drivers/of/of_reserved_mem.c | 10 | ||||
-rw-r--r-- | drivers/of/platform.c | 2 | ||||
-rw-r--r-- | drivers/of/property.c | 20 |
6 files changed, 27 insertions, 19 deletions
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c index 08fd823edac9..fe64430b438a 100644 --- a/drivers/of/dynamic.c +++ b/drivers/of/dynamic.c @@ -286,7 +286,6 @@ int of_detach_node(struct device_node *np) { struct of_reconfig_data rd; unsigned long flags; - int rc = 0; memset(&rd, 0, sizeof(rd)); rd.dn = np; @@ -301,7 +300,7 @@ int of_detach_node(struct device_node *np) of_reconfig_notify(OF_RECONFIG_DETACH_NODE, &rd); - return rc; + return 0; } EXPORT_SYMBOL_GPL(of_detach_node); diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 2cdf64d2456f..4602e467ca8b 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -471,7 +471,7 @@ void *initial_boot_params __ro_after_init; static u32 of_fdt_crc32; /** - * res_mem_reserve_reg() - reserve all memory described in 'reg' property + * __reserved_mem_reserve_reg() - reserve all memory described in 'reg' property */ static int __init __reserved_mem_reserve_reg(unsigned long node, const char *uname) @@ -643,8 +643,6 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node, offset = fdt_next_node(blob, offset, &depth)) { pathp = fdt_get_name(blob, offset, NULL); - if (*pathp == '/') - pathp = kbasename(pathp); rc = it(offset, pathp, depth, data); } return rc; @@ -671,8 +669,6 @@ int __init of_scan_flat_dt_subnodes(unsigned long parent, int rc; pathp = fdt_get_name(blob, node, NULL); - if (*pathp == '/') - pathp = kbasename(pathp); rc = it(node, pathp, data); if (rc) return rc; @@ -1078,7 +1074,7 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname, #endif #endif /* CONFIG_CMDLINE */ - pr_debug("Command line is: %s\n", (char*)data); + pr_debug("Command line is: %s\n", (char *)data); rng_seed = of_get_flat_dt_prop(node, "rng-seed", &l); if (rng_seed && l > 0) { diff --git a/drivers/of/kobj.c b/drivers/of/kobj.c index c72eef988041..a32e60b024b8 100644 --- a/drivers/of/kobj.c +++ b/drivers/of/kobj.c @@ -134,8 +134,6 @@ int __of_attach_node_sysfs(struct device_node *np) if (!name) return -ENOMEM; - of_node_get(np); - rc = kobject_add(&np->kobj, parent, "%s", name); kfree(name); if (rc) @@ -144,6 +142,7 @@ int __of_attach_node_sysfs(struct device_node *np) for_each_property_of_node(np, pp) __of_add_property_sysfs(np, pp); + of_node_get(np); return 0; } diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index f61e8739502a..6877080c8af9 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -46,7 +46,7 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size, } /** - * res_mem_save_node() - save fdt node for second pass initialization + * fdt_reserved_mem_save_node() - save fdt node for second pass initialization */ void __init fdt_reserved_mem_save_node(unsigned long node, const char *uname, phys_addr_t base, phys_addr_t size) @@ -68,8 +68,8 @@ void __init fdt_reserved_mem_save_node(unsigned long node, const char *uname, } /** - * res_mem_alloc_size() - allocate reserved memory described by 'size', 'align' - * and 'alloc-ranges' properties + * __reserved_mem_alloc_size() - allocate reserved memory described by + * 'size', 'align' and 'alloc-ranges' properties. */ static int __init __reserved_mem_alloc_size(unsigned long node, const char *uname, phys_addr_t *res_base, phys_addr_t *res_size) @@ -165,7 +165,7 @@ static const struct of_device_id __rmem_of_table_sentinel __used __section(__reservedmem_of_table_end); /** - * res_mem_init_node() - call region specific reserved memory init code + * __reserved_mem_init_node() - call region specific reserved memory init code */ static int __init __reserved_mem_init_node(struct reserved_mem *rmem) { @@ -232,7 +232,7 @@ static void __init __rmem_check_for_overlap(void) } /** - * fdt_init_reserved_mem - allocate and init all saved reserved memory regions + * fdt_init_reserved_mem() - allocate and init all saved reserved memory regions */ void __init fdt_init_reserved_mem(void) { diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 3371e4a06248..3627fee60215 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c @@ -291,7 +291,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node, #endif /* CONFIG_ARM_AMBA */ /** - * of_devname_lookup() - Given a device node, lookup the preferred Linux name + * of_dev_lookup() - Given a device node, lookup the preferred Linux name */ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *lookup, struct device_node *np) diff --git a/drivers/of/property.c b/drivers/of/property.c index b4916dcc9e72..1f2086f4e7ce 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1045,8 +1045,20 @@ static int of_link_to_phandle(struct device *dev, struct device_node *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. */ - while (sup_np && !of_find_property(sup_np, "compatible", NULL)) + 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) { dev_dbg(dev, "Not linking to %pOFP - No device\n", tmp_np); return -ENODEV; @@ -1074,7 +1086,7 @@ static int of_link_to_phandle(struct device *dev, struct device_node *sup_np, return -EAGAIN; } if (!device_link_add(dev, sup_dev, dl_flags)) - ret = -EAGAIN; + ret = -EINVAL; put_device(sup_dev); return ret; } @@ -1206,6 +1218,7 @@ DEFINE_SIMPLE_PROP(interrupt_parent, "interrupt-parent", NULL) DEFINE_SIMPLE_PROP(dmas, "dmas", "#dma-cells") DEFINE_SIMPLE_PROP(power_domains, "power-domains", "#power-domain-cells") DEFINE_SIMPLE_PROP(hwlocks, "hwlocks", "#hwlock-cells") +DEFINE_SIMPLE_PROP(extcon, "extcon", NULL) DEFINE_SUFFIX_PROP(regulators, "-supply", NULL) DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells") DEFINE_SUFFIX_PROP(gpios, "-gpios", "#gpio-cells") @@ -1230,6 +1243,7 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_dmas, }, { .parse_prop = parse_power_domains, }, { .parse_prop = parse_hwlocks, }, + { .parse_prop = parse_extcon, }, { .parse_prop = parse_regulators, }, { .parse_prop = parse_gpio, }, { .parse_prop = parse_gpios, }, @@ -1296,7 +1310,7 @@ static int of_link_to_suppliers(struct device *dev, if (of_link_property(dev, con_np, p->name)) ret = -ENODEV; - for_each_child_of_node(con_np, child) + for_each_available_child_of_node(con_np, child) if (of_link_to_suppliers(dev, child) && !ret) ret = -EAGAIN; |