summaryrefslogtreecommitdiff
path: root/drivers
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
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')
-rw-r--r--drivers/cdx/cdx.c15
-rw-r--r--drivers/clk/imx/clk-imx27.c7
-rw-r--r--drivers/clk/imx/clk-imx31.c7
-rw-r--r--drivers/cpufreq/s5pv210-cpufreq.c10
-rw-r--r--drivers/dma/fsl_raid.c4
-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
9 files changed, 43 insertions, 73 deletions
diff --git a/drivers/cdx/cdx.c b/drivers/cdx/cdx.c
index b39af2f1937f..588dd12e8105 100644
--- a/drivers/cdx/cdx.c
+++ b/drivers/cdx/cdx.c
@@ -608,7 +608,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
{
struct cdx_controller *cdx;
struct platform_device *pd;
- struct device_node *np;
bool val;
if (kstrtobool(buf, &val) < 0)
@@ -617,19 +616,16 @@ static ssize_t rescan_store(const struct bus_type *bus,
if (!val)
return -EINVAL;
- mutex_lock(&cdx_controller_lock);
+ guard(mutex)(&cdx_controller_lock);
/* Unregister all the devices on the bus */
cdx_unregister_devices(&cdx_bus_type);
/* Rescan all the devices */
- for_each_compatible_node(np, NULL, compat_node_name) {
+ for_each_compatible_node_scoped(np, NULL, compat_node_name) {
pd = of_find_device_by_node(np);
- if (!pd) {
- of_node_put(np);
- count = -EINVAL;
- goto unlock;
- }
+ if (!pd)
+ return -EINVAL;
cdx = platform_get_drvdata(pd);
if (cdx && cdx->controller_registered && cdx->ops->scan)
@@ -638,9 +634,6 @@ static ssize_t rescan_store(const struct bus_type *bus,
put_device(&pd->dev);
}
-unlock:
- mutex_unlock(&cdx_controller_lock);
-
return count;
}
static BUS_ATTR_WO(rescan);
diff --git a/drivers/clk/imx/clk-imx27.c b/drivers/clk/imx/clk-imx27.c
index 99618ded0939..f2f0d3fe5c52 100644
--- a/drivers/clk/imx/clk-imx27.c
+++ b/drivers/clk/imx/clk-imx27.c
@@ -171,17 +171,14 @@ static void __init _mx27_clocks_init(unsigned long fref)
static void __init mx27_clocks_init_dt(struct device_node *np)
{
- struct device_node *refnp;
u32 fref = 26000000; /* default */
- for_each_compatible_node(refnp, NULL, "fixed-clock") {
+ for_each_compatible_node_scoped(refnp, NULL, "fixed-clock") {
if (!of_device_is_compatible(refnp, "fsl,imx-osc26m"))
continue;
- if (!of_property_read_u32(refnp, "clock-frequency", &fref)) {
- of_node_put(refnp);
+ if (!of_property_read_u32(refnp, "clock-frequency", &fref))
break;
- }
}
ccm = of_iomap(np, 0);
diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
index 4c8d9ff0b2ad..962eccac63ce 100644
--- a/drivers/clk/imx/clk-imx31.c
+++ b/drivers/clk/imx/clk-imx31.c
@@ -123,18 +123,15 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
static void __init mx31_clocks_init_dt(struct device_node *np)
{
- struct device_node *osc_np;
u32 fref = 26000000; /* default */
void __iomem *ccm;
- for_each_compatible_node(osc_np, NULL, "fixed-clock") {
+ for_each_compatible_node_scoped(osc_np, NULL, "fixed-clock") {
if (!of_device_is_compatible(osc_np, "fsl,imx-osc26m"))
continue;
- if (!of_property_read_u32(osc_np, "clock-frequency", &fref)) {
- of_node_put(osc_np);
+ if (!of_property_read_u32(osc_np, "clock-frequency", &fref))
break;
- }
}
ccm = of_iomap(np, 0);
diff --git a/drivers/cpufreq/s5pv210-cpufreq.c b/drivers/cpufreq/s5pv210-cpufreq.c
index ba8a1c96427a..e64e84e1ee79 100644
--- a/drivers/cpufreq/s5pv210-cpufreq.c
+++ b/drivers/cpufreq/s5pv210-cpufreq.c
@@ -629,19 +629,17 @@ static int s5pv210_cpufreq_probe(struct platform_device *pdev)
goto err_clock;
}
- for_each_compatible_node(np, NULL, "samsung,s5pv210-dmc") {
- id = of_alias_get_id(np, "dmc");
+ for_each_compatible_node_scoped(dmc, NULL, "samsung,s5pv210-dmc") {
+ id = of_alias_get_id(dmc, "dmc");
if (id < 0 || id >= ARRAY_SIZE(dmc_base)) {
- dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", np);
- of_node_put(np);
+ dev_err(dev, "failed to get alias of dmc node '%pOFn'\n", dmc);
result = id;
goto err_clk_base;
}
- dmc_base[id] = of_iomap(np, 0);
+ dmc_base[id] = of_iomap(dmc, 0);
if (!dmc_base[id]) {
dev_err(dev, "failed to map dmc%d registers\n", id);
- of_node_put(np);
result = -EFAULT;
goto err_dmc;
}
diff --git a/drivers/dma/fsl_raid.c b/drivers/dma/fsl_raid.c
index 6aa97e258a55..6e6d7e0e475e 100644
--- a/drivers/dma/fsl_raid.c
+++ b/drivers/dma/fsl_raid.c
@@ -746,7 +746,6 @@ err_free:
static int fsl_re_probe(struct platform_device *ofdev)
{
struct fsl_re_drv_private *re_priv;
- struct device_node *np;
struct device_node *child;
u32 off;
u8 ridx = 0;
@@ -823,11 +822,10 @@ static int fsl_re_probe(struct platform_device *ofdev)
dev_set_drvdata(dev, re_priv);
/* Parse Device tree to find out the total number of JQs present */
- for_each_compatible_node(np, NULL, "fsl,raideng-v1.0-job-queue") {
+ for_each_compatible_node_scoped(np, NULL, "fsl,raideng-v1.0-job-queue") {
rc = of_property_read_u32(np, "reg", &off);
if (rc) {
dev_err(dev, "Reg property not found in JQ node\n");
- of_node_put(np);
return -ENODEV;
}
/* Find out the Job Rings present under each JQ */
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
}