diff options
author | Oreoluwa Babatunde <quic_obabatun@quicinc.com> | 2024-05-02 12:24:03 -0700 |
---|---|---|
committer | Rob Herring (Arm) <robh@kernel.org> | 2024-05-03 07:49:13 -0500 |
commit | c56436ef17520c5fb0f9c2fc47aa961a7946895f (patch) | |
tree | 29f7e46d012ecee6067d5d86db04c72a199fcc65 /drivers/mfd/tps65912-spi.c | |
parent | 669430b183fccb3a8b39000a1e9dfb3a2d3028ce (diff) |
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>
Diffstat (limited to 'drivers/mfd/tps65912-spi.c')
0 files changed, 0 insertions, 0 deletions