diff options
author | Rob Herring <robh@kernel.org> | 2023-06-09 12:31:50 -0600 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-06-21 15:13:46 +1000 |
commit | f892ac774b34a769318030f5febe5ce41d6e122e (patch) | |
tree | aecf919413d77d7f2fdf8f9c04c9cb73776b3200 /arch/powerpc/sysdev/fsl_rmu.c | |
parent | c4ae1799a5a358388acb610512c68666f8758364 (diff) | |
download | linux-stable-f892ac774b34a769318030f5febe5ce41d6e122e.tar.gz linux-stable-f892ac774b34a769318030f5febe5ce41d6e122e.tar.bz2 linux-stable-f892ac774b34a769318030f5febe5ce41d6e122e.zip |
powerpc: fsl: Use of_property_read_reg() to parse "reg"
Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.
Signed-off-by: Rob Herring <robh@kernel.org>
[mpe: Add required include of of_address.h]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230609183151.1766261-1-robh@kernel.org
Diffstat (limited to 'arch/powerpc/sysdev/fsl_rmu.c')
-rw-r--r-- | arch/powerpc/sysdev/fsl_rmu.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c index 7a5e2e2b9d06..c1f724973589 100644 --- a/arch/powerpc/sysdev/fsl_rmu.c +++ b/arch/powerpc/sysdev/fsl_rmu.c @@ -23,6 +23,7 @@ #include <linux/types.h> #include <linux/dma-mapping.h> #include <linux/interrupt.h> +#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/slab.h> @@ -1067,9 +1068,6 @@ int fsl_rio_setup_rmu(struct rio_mport *mport, struct device_node *node) struct rio_priv *priv; struct fsl_rmu *rmu; u64 msg_start; - const u32 *msg_addr; - int mlen; - int aw; if (!mport || !mport->priv) return -EINVAL; @@ -1086,16 +1084,12 @@ int fsl_rio_setup_rmu(struct rio_mport *mport, struct device_node *node) if (!rmu) return -ENOMEM; - aw = of_n_addr_cells(node); - msg_addr = of_get_property(node, "reg", &mlen); - if (!msg_addr) { + if (of_property_read_reg(node, 0, &msg_start, NULL)) { pr_err("%pOF: unable to find 'reg' property of message-unit\n", node); kfree(rmu); return -ENOMEM; } - msg_start = of_read_number(msg_addr, aw); - rmu->msg_regs = (struct rio_msg_regs *) (rmu_regs_win + (u32)msg_start); |