summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-11 18:27:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-11 18:27:08 -0800
commit098b6e44cbaa2d526d06af90c862d13fb414a0ec (patch)
tree2fb8ca29a59b2f60846bfaa3573c0e8aa55507a4 /drivers/of
parentc6e62d002b7f0613f02d8707c80f2a7bd66808a0 (diff)
parenta16f91f80735e653b88370b840d5c771f2c175c5 (diff)
Merge tag 'devicetree-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree updates from Rob Herring: "DT core: - Sync dtc/libfdt with upstream v1.7.2-62-ga26ef6400bd8 - Add a for_each_compatible_node_scoped() loop and convert users in cpufreq, dmaengine, clk, cdx, powerpc and Arm - Simplify of/platform.c with scoped loop helpers - Add fw_devlink tracking for "mmc-pwrseq" - Optimize fw_devlink callback code size for pinctrl-N properties - Replace strcmp_suffix() with strends() DT bindings: - Support building single binding targets - Convert google,goldfish-fb, cznic,turris-mox-rwtm, ti,prm-inst - Add bindings for Freescale AVIC, Realtek RTD1xxx system controllers, Microchip 25AA010A EEPROM, OnSemi FIN3385, IEI WT61P803 PUZZLE, Delta Electronics DPS-800-AB power supply, Infineon IR35221 Digital Multi-phase Controller, Infineon PXE1610 Digital Dual Output 6+1 VR12.5 & VR13 CPU Controller, socionext,uniphier-smpctrl, and xlnx,zynqmp-firmware - Lots of trivial binding fixes to address warnings in DTS files. These are mostly for arm64 platforms which is getting closer to be warning free. Some public shaming has helped. - Fix I2C bus node names in examples - Drop obsolete brcm,vulcan-soc binding - Drop unreferenced binding headers" * tag 'devicetree-for-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (60 commits) dt-bindings: interrupt-controller: Add compatiblie string fsl,imx(1|25|27|31|35)-avic dt-bindings: soc: imx: add fsl,aips and fsl,emi compatible strings dt-bindings: display: bridge: lt8912b: Drop reset gpio requirement dt-bindings: firmware: fsl,scu: Mark multi-channel MU layouts as deprecated cpufreq: s5pv210: Simplify with scoped for each OF child loop dmaengine: fsl_raid: Simplify with scoped for each OF child loop clk: imx: imx31: Simplify with scoped for each OF child loop clk: imx: imx27: Simplify with scoped for each OF child loop cdx: Use mutex guard to simplify error handling cdx: Simplify with scoped for each OF child loop powerpc/wii: Simplify with scoped for each OF child loop powerpc/fsp2: Simplify with scoped for each OF child loop ARM: exynos: Simplify with scoped for each OF child loop ARM: at91: Simplify with scoped for each OF child loop of: Add for_each_compatible_node_scoped() helper dt-bindings: Fix emails with spaces or missing brackets scripts/dtc: Update to upstream version v1.7.2-62-ga26ef6400bd8 dt-bindings: crypto: inside-secure,safexcel: Mandate only ring IRQs dt-bindings: crypto: inside-secure,safexcel: Add SoC compatibles of: reserved_mem: Fix placement of __free() annotation ...
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_reserved_mem.c3
-rw-r--r--drivers/of/platform.c15
-rw-r--r--drivers/of/property.c49
-rw-r--r--drivers/of/unittest.c6
4 files changed, 30 insertions, 43 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index a2a13617c6f4..31c5bc751d0d 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -127,7 +127,6 @@ static void __init fdt_reserved_mem_save_node(unsigned long node, const char *un
fdt_init_reserved_mem_node(rmem);
reserved_mem_count++;
- return;
}
static int __init early_init_dt_reserve_memory(phys_addr_t base,
@@ -762,7 +761,7 @@ int of_reserved_mem_region_to_resource(const struct device_node *np,
if (!np)
return -EINVAL;
- struct device_node __free(device_node) *target = of_parse_phandle(np, "memory-region", idx);
+ struct device_node *target __free(device_node) = of_parse_phandle(np, "memory-region", idx);
if (!target || !of_device_is_available(target))
return -ENODEV;
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index a6dca3a005aa..d90b1677d84e 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -394,7 +394,6 @@ int of_platform_bus_probe(struct device_node *root,
const struct of_device_id *matches,
struct device *parent)
{
- struct device_node *child;
int rc = 0;
root = root ? of_node_get(root) : of_find_node_by_path("/");
@@ -407,13 +406,13 @@ int of_platform_bus_probe(struct device_node *root,
/* Do a self check of bus type, if there's a match, create children */
if (of_match_node(matches, root)) {
rc = of_platform_bus_create(root, matches, NULL, parent, false);
- } else for_each_child_of_node(root, child) {
- if (!of_match_node(matches, child))
- continue;
- rc = of_platform_bus_create(child, matches, NULL, parent, false);
- if (rc) {
- of_node_put(child);
- break;
+ } else {
+ for_each_child_of_node_scoped(root, child) {
+ if (!of_match_node(matches, child))
+ continue;
+ rc = of_platform_bus_create(child, matches, NULL, parent, false);
+ if (rc)
+ break;
}
}
diff --git a/drivers/of/property.c b/drivers/of/property.c
index 4e3524227720..50d95d512bf5 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -21,6 +21,7 @@
#define pr_fmt(fmt) "OF: " fmt
+#include <linux/ctype.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
@@ -1294,17 +1295,6 @@ static struct device_node *parse_##fname(struct device_node *np, \
return parse_prop_cells(np, prop_name, index, name, cells); \
}
-static int strcmp_suffix(const char *str, const char *suffix)
-{
- unsigned int len, suffix_len;
-
- len = strlen(str);
- suffix_len = strlen(suffix);
- if (len <= suffix_len)
- return -1;
- return strcmp(str + len - suffix_len, suffix);
-}
-
/**
* parse_suffix_prop_cells - Suffix property parsing function for suppliers
*
@@ -1331,7 +1321,7 @@ static struct device_node *parse_suffix_prop_cells(struct device_node *np,
{
struct of_phandle_args sup_args;
- if (strcmp_suffix(prop_name, suffix))
+ if (!strends(prop_name, suffix))
return NULL;
if (of_parse_phandle_with_args(np, prop_name, cells_name, index,
@@ -1391,15 +1381,6 @@ DEFINE_SIMPLE_PROP(extcon, "extcon", NULL)
DEFINE_SIMPLE_PROP(nvmem_cells, "nvmem-cells", "#nvmem-cell-cells")
DEFINE_SIMPLE_PROP(phys, "phys", "#phy-cells")
DEFINE_SIMPLE_PROP(wakeup_parent, "wakeup-parent", NULL)
-DEFINE_SIMPLE_PROP(pinctrl0, "pinctrl-0", NULL)
-DEFINE_SIMPLE_PROP(pinctrl1, "pinctrl-1", NULL)
-DEFINE_SIMPLE_PROP(pinctrl2, "pinctrl-2", NULL)
-DEFINE_SIMPLE_PROP(pinctrl3, "pinctrl-3", NULL)
-DEFINE_SIMPLE_PROP(pinctrl4, "pinctrl-4", NULL)
-DEFINE_SIMPLE_PROP(pinctrl5, "pinctrl-5", NULL)
-DEFINE_SIMPLE_PROP(pinctrl6, "pinctrl-6", NULL)
-DEFINE_SIMPLE_PROP(pinctrl7, "pinctrl-7", NULL)
-DEFINE_SIMPLE_PROP(pinctrl8, "pinctrl-8", NULL)
DEFINE_SIMPLE_PROP(pwms, "pwms", "#pwm-cells")
DEFINE_SIMPLE_PROP(resets, "resets", "#reset-cells")
DEFINE_SIMPLE_PROP(leds, "leds", NULL)
@@ -1410,13 +1391,26 @@ DEFINE_SIMPLE_PROP(post_init_providers, "post-init-providers", NULL)
DEFINE_SIMPLE_PROP(access_controllers, "access-controllers", "#access-controller-cells")
DEFINE_SIMPLE_PROP(pses, "pses", "#pse-cells")
DEFINE_SIMPLE_PROP(power_supplies, "power-supplies", NULL)
+DEFINE_SIMPLE_PROP(mmc_pwrseq, "mmc-pwrseq", NULL)
DEFINE_SUFFIX_PROP(regulators, "-supply", NULL)
DEFINE_SUFFIX_PROP(gpio, "-gpio", "#gpio-cells")
+static struct device_node *parse_pinctrl_n(struct device_node *np,
+ const char *prop_name, int index)
+{
+ if (!strstarts(prop_name, "pinctrl-"))
+ return NULL;
+
+ if (!isdigit(prop_name[strlen("pinctrl-")]))
+ return NULL;
+
+ return of_parse_phandle(np, prop_name, index);
+}
+
static struct device_node *parse_gpios(struct device_node *np,
const char *prop_name, int index)
{
- if (!strcmp_suffix(prop_name, ",nr-gpios"))
+ if (strends(prop_name, ",nr-gpios"))
return NULL;
return parse_suffix_prop_cells(np, prop_name, index, "-gpios",
@@ -1536,15 +1530,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_nvmem_cells, },
{ .parse_prop = parse_phys, },
{ .parse_prop = parse_wakeup_parent, },
- { .parse_prop = parse_pinctrl0, },
- { .parse_prop = parse_pinctrl1, },
- { .parse_prop = parse_pinctrl2, },
- { .parse_prop = parse_pinctrl3, },
- { .parse_prop = parse_pinctrl4, },
- { .parse_prop = parse_pinctrl5, },
- { .parse_prop = parse_pinctrl6, },
- { .parse_prop = parse_pinctrl7, },
- { .parse_prop = parse_pinctrl8, },
+ { .parse_prop = parse_pinctrl_n, },
{
.parse_prop = parse_remote_endpoint,
.get_con_dev = of_graph_get_port_parent,
@@ -1557,6 +1543,7 @@ static const struct supplier_bindings of_supplier_bindings[] = {
{ .parse_prop = parse_msi_parent, },
{ .parse_prop = parse_pses, },
{ .parse_prop = parse_power_supplies, },
+ { .parse_prop = parse_mmc_pwrseq, },
{ .parse_prop = parse_gpio_compat, },
{ .parse_prop = parse_interrupts, },
{ .parse_prop = parse_interrupt_map, },
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 7eccb5d9135f..a9cc2c990562 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -804,11 +804,13 @@ static void __init of_unittest_property_copy(void)
new = __of_prop_dup(&p1, GFP_KERNEL);
unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n");
- __of_prop_free(new);
+ if (new)
+ __of_prop_free(new);
new = __of_prop_dup(&p2, GFP_KERNEL);
unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n");
- __of_prop_free(new);
+ if (new)
+ __of_prop_free(new);
#endif
}