]> git.itanic.dy.fi Git - linux-stable/commit
of: base: add of_parse_phandle_with_optional_args()
authorMichael Walle <michael@walle.cc>
Mon, 6 Feb 2023 13:43:43 +0000 (13:43 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 6 Feb 2023 18:06:58 +0000 (19:06 +0100)
commitc5d264d4b527c96ae8903376a4b195df47b05203
tree583169312beaf4d2b4ef7d50dfb6857f86ecb523
parent7390609b0121a1b982c5ecdfcd72dc328e5784ee
of: base: add of_parse_phandle_with_optional_args()

Add a new variant of the of_parse_phandle_with_args() which treats the
cells name as optional. If it's missing, it is assumed that the phandle
has no arguments.

Up until now, a nvmem node didn't have any arguments, so all the device
trees haven't any '#*-cells' property. But there is a need for an
additional argument for the phandle, for which we need a '#*-cells'
property. Therefore, we need to support nvmem nodes with and without
this property.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230206134356.839737-10-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/of.h