summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-06-26 09:14:52 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-06-26 09:14:52 -0700
commitfc91b7d77d78c6381b437b7c96aca6b03f7bbfed (patch)
treef73b4d52754f196a96c20bfdd6b560660dada377 /drivers
parent51cb1aa1250c36269474b8b6ca6b6319e170f5a5 (diff)
parentb39a6b2e9d5bd6a3153aed4c7440172b8f6a739e (diff)
Merge tag 'devicetree-fixes-for-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree fixes from Rob Herring: - Drop unnecessary type reference from khadas,mcu "fan-supply" - Fix clocks in Renesas R-Mobile APE6 example - Add missing Unisoc SC2730 PMIC regulators schema - Fix Amlogic thermal example - kernel-doc fix for of_map_id() - Handle negative index in of_fwnode_get_reference_args() * tag 'devicetree-fixes-for-7.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: mfd: khadas,mcu: Drop type reference from "fan-supply" dt-bindings: clock: renesas: div6: Use ZT/ZTR trace clock in R-Mobile APE6 example regulator: dt-bindings: Add Unisoc SC2730 PMIC dt-bindings: thermal: amlogic: Correct 'reg' in the example dt-bindings: thermal: amlogic: Fix missing header in the example of: Fix RST inline emphasis warnings in of_map_id() kernel-doc of: property: Fix of_fwnode_get_reference_args() with negative index
Diffstat (limited to 'drivers')
-rw-r--r--drivers/of/base.c4
-rw-r--r--drivers/of/property.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7cb0d7e88247..6e7a42dedad3 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2160,7 +2160,7 @@ static bool of_check_bad_map(const __be32 *map, int len)
* @map_mask_name: optional property name of the mask to use.
* @filter_np: pointer to an optional filter node, or NULL to allow bypass.
* If non-NULL, the map property must exist (-ENODEV if absent). If
- * *filter_np is also non-NULL, only entries targeting that node match.
+ * ``*filter_np`` is also non-NULL, only entries targeting that node match.
* @arg: pointer to a &struct of_phandle_args for the result. On success,
* @arg->args_count will be set to the number of output specifier cells
* as defined by @cells_name in the target node, and
@@ -2350,7 +2350,7 @@ EXPORT_SYMBOL_GPL(of_map_iommu_id);
* stream/device ID) used as the lookup key in the msi-map table.
* @filter_np: pointer to an optional filter node, or NULL to allow bypass.
* If non-NULL, the map property must exist (-ENODEV if absent). If
- * *filter_np is also non-NULL, only entries targeting that node match.
+ * ``*filter_np`` is also non-NULL, only entries targeting that node match.
* @arg: pointer to a &struct of_phandle_args for the result. On success,
* @arg->args_count will be set to the number of output specifier cells
* and @arg->args[0..args_count-1] will contain the translated output
diff --git a/drivers/of/property.c b/drivers/of/property.c
index b276d1de3222..72cf12907de0 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1172,6 +1172,14 @@ of_fwnode_get_reference_args(const struct fwnode_handle *fwnode,
unsigned int i;
int ret;
+ /*
+ * This function should return -ENOENT for out of bound indexes,
+ * but the OF API uses signed indexes and consider negative indexes
+ * as invalid. Catch them here to correctly implement the fwnode API.
+ */
+ if ((int)index < 0)
+ return -ENOENT;
+
if (nargs_prop)
ret = of_parse_phandle_with_args(to_of_node(fwnode), prop,
nargs_prop, index, &of_args);