Skip to content

Commit ee174e2

Browse files
robherringherbertx
authored andcommitted
crypto: n2 - 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 <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 2382b5a commit ee174e2

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/crypto/n2_core.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
1111
#include <linux/of.h>
12+
#include <linux/of_address.h>
1213
#include <linux/of_device.h>
1314
#include <linux/cpumask.h>
1415
#include <linux/slab.h>
@@ -1795,11 +1796,9 @@ static int grab_mdesc_irq_props(struct mdesc_handle *mdesc,
17951796
struct spu_mdesc_info *ip,
17961797
const char *node_name)
17971798
{
1798-
const unsigned int *reg;
1799-
u64 node;
1799+
u64 node, reg;
18001800

1801-
reg = of_get_property(dev->dev.of_node, "reg", NULL);
1802-
if (!reg)
1801+
if (of_property_read_reg(dev->dev.of_node, 0, &reg, NULL) < 0)
18031802
return -ENODEV;
18041803

18051804
mdesc_for_each_node_by_name(mdesc, node, "virtual-device") {
@@ -1810,7 +1809,7 @@ static int grab_mdesc_irq_props(struct mdesc_handle *mdesc,
18101809
if (!name || strcmp(name, node_name))
18111810
continue;
18121811
chdl = mdesc_get_property(mdesc, node, "cfg-handle", NULL);
1813-
if (!chdl || (*chdl != *reg))
1812+
if (!chdl || (*chdl != reg))
18141813
continue;
18151814
ip->cfg_handle = *chdl;
18161815
return get_irq_props(mdesc, node, ip);

0 commit comments

Comments
 (0)