powerpc: fsl_rio: Use of_range_to_resource() for "ranges" parsing
authorRob Herring <robh@kernel.org>
Fri, 9 Jun 2023 18:32:44 +0000 (12:32 -0600)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 21 Jun 2023 05:10:38 +0000 (15:10 +1000)
commitc4ae1799a5a358388acb610512c68666f8758364
tree4100a6743bc5e1f1cfeedb3a9a83914b425b491f
parent6f3bdbbeafbbcb1a6540307e4eaee10ecae4f9a5
powerpc: fsl_rio: Use of_range_to_resource() for "ranges" parsing

"ranges" is a standard property with common parsing functions. Users
shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO
"ranges" parsing to use of_range_to_resource() instead.

One change is the original code would look for "#size-cells" and
"#address-cells" in the parent node if not found in the port child
nodes. That is non-standard behavior and not necessary AFAICT. In 2011
in commit 54986964c13c ("powerpc/85xx: Update SRIO device tree nodes")
there was an ABI break. The upstream .dts files have been correct since
at least that point.

Signed-off-by: Rob Herring <robh@kernel.org>
[mpe: Remove now unused "cell" variable]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230609183244.1767325-1-robh@kernel.org
"ranges" is a standard property with common parsing functions. Users
shouldn't be implementing their own parsing of it. Refactor the FSL RapidIO
"ranges" parsing to use of_range_to_resource() instead.

One change is the original code would look for "#size-cells" and
"#address-cells" in the parent node if not found in the port child
nodes. That is non-standard behavior and not necessary AFAICT. In 2011
in commit 54986964c13c ("powerpc/85xx: Update SRIO device tree nodes")
there was an ABI break. The upstream .dts files have been correct since
at least that point.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230609183244.1767325-1-robh@kernel.org
arch/powerpc/sysdev/fsl_rio.c