linux/drivers/of
Oreoluwa Babatunde c56436ef17 of: reserved_mem: Remove the use of phandle from the reserved_mem APIs
The __find_rmem() function is the only place that references the phandle
field of the reserved_mem struct. __find_rmem() is used to match a
device_node object to its corresponding entry in the reserved_mem array
using its phandle value. But, there is already a function called
of_reserved_mem_lookup() which carries out the same action using the
name of the node.

Using the of_reserved_mem_lookup() function is more reliable because
every node is guaranteed to have a name, but not all nodes will have a
phandle.

Nodes are only assigned a phandle if they are explicitly defined in the
DT using "phandle = <phandle_number>", or if they are referenced by
another node in the DT. Hence, If the phandle field is empty, then
__find_rmem() will return a false negative.

Hence, delete the __find_rmem() function and switch to using the
of_reserved_mem_lookup() function to find the corresponding entry of a
device_node in the reserved_mem array. Since the phandle field of the
reserved_mem struct is now unused, delete that as well.

Signed-off-by: Oreoluwa Babatunde <quic_obabatun@quicinc.com>
Link: https://lore.kernel.org/r/20240502192403.3307277-1-quic_obabatun@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2024-05-03 07:49:13 -05:00
..
unittest-data of: Fix double free in of_parse_phandle_with_args_map 2024-01-09 12:54:02 -06:00
.kunitconfig of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
address.c of: Use scope based of_node_put() cleanups 2024-04-15 08:40:40 -05:00
base.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
cpu.c of: Move CPU node related functions to their own file 2023-04-13 17:46:34 -05:00
device.c IOMMU Updates for Linux v6.8 2024-01-18 15:16:57 -08:00
dynamic.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
empty_root.dts of: Create of_root if no dtb provided by firmware 2024-03-08 12:50:39 -06:00
fdt_address.c of: Use SPDX license tag for DT files 2018-01-08 08:22:45 -06:00
fdt.c of: Move all FDT reserved-memory handling into of_reserved_mem.c 2024-03-12 09:23:26 -06:00
irq.c of/irq: add missing of_node_put() for interrupt parent node 2023-01-18 11:31:42 -06:00
Kconfig of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
kexec.c arm64, crash: wrap crash dumping code into crash related ifdefs 2024-02-23 17:48:23 -08:00
kobj.c of: make of_node_ktype constant 2023-02-06 11:03:00 -06:00
Makefile of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
module.c of: Move the request module helper logic to module.c 2023-04-05 19:41:10 +02:00
of_numa.c of, numa: Fetch empty NUMA node ID from distance map 2021-10-04 13:13:44 -05:00
of_private.h of: Add a helper to free property struct 2024-04-15 08:40:40 -05:00
of_reserved_mem.c of: reserved_mem: Remove the use of phandle from the reserved_mem APIs 2024-05-03 07:49:13 -05:00
of_test.c of: Add KUnit test to confirm DTB is loaded 2024-03-08 12:50:39 -06:00
overlay.c of: Add a helper to free property struct 2024-04-15 08:40:40 -05:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c of: Create of_root if no dtb provided by firmware 2024-03-08 12:50:39 -06:00
property.c of: property: fw_devlink: Add support for "power-supplies" binding 2024-04-23 11:33:10 -05:00
resolver.c of: Use scope based kfree() cleanups 2024-04-15 08:40:40 -05:00
unittest.c of: Add a helper to free property struct 2024-04-15 08:40:40 -05:00