diff options
author | Rob Herring <robh@kernel.org> | 2023-03-30 01:03:36 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-04-04 15:11:03 +0300 |
commit | 2500763dd3db37fad94d9b506907c59c2f5e97c6 (patch) | |
tree | a4cd9241b504c57d5011764311a00c8062461f98 /arch/powerpc/platforms/cell | |
parent | 83a8fe569ef84d6eefcb99420a731cb87508f004 (diff) | |
download | linux-2500763dd3db37fad94d9b506907c59c2f5e97c6.tar.xz |
powerpc: Use of_address_to_resource()
Replace open coded reading of "reg" or of_get_address()/
of_translate_address() calls with a single call to
of_address_to_resource().
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230329220337.141295-1-robh@kernel.org
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/axon_msi.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 0c11aad896c7..106000449d3b 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -460,15 +460,14 @@ DEFINE_SIMPLE_ATTRIBUTE(fops_msic, msic_get, msic_set, "%llu\n"); void axon_msi_debug_setup(struct device_node *dn, struct axon_msic *msic) { char name[8]; - u64 addr; + struct resource res; - addr = of_translate_address(dn, of_get_property(dn, "reg", NULL)); - if (addr == OF_BAD_ADDR) { - pr_devel("axon_msi: couldn't translate reg property\n"); + if (of_address_to_resource(dn, 0, &res)) { + pr_devel("axon_msi: couldn't get reg property\n"); return; } - msic->trigger = ioremap(addr, 0x4); + msic->trigger = ioremap(res.start, 0x4); if (!msic->trigger) { pr_devel("axon_msi: ioremap failed\n"); return; |