Skip to content

Commit c7fe3bb

Browse files
robherringlag-linaro
authored andcommitted
mfd: core: 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> Link: https://lore.kernel.org/r/20230609183159.1766429-1-robh@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
1 parent 7c81582 commit c7fe3bb

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/mfd/mfd-core.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
102102
{
103103
#if IS_ENABLED(CONFIG_OF)
104104
struct mfd_of_node_entry *of_entry;
105-
const __be32 *reg;
106105
u64 of_node_addr;
107106

108107
/* Skip if OF node has previously been allocated to a device */
@@ -115,13 +114,10 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
115114
goto allocate_of_node;
116115

117116
/* We only care about each node's first defined address */
118-
reg = of_get_address(np, 0, NULL, NULL);
119-
if (!reg)
117+
if (of_property_read_reg(np, 0, &of_node_addr, NULL))
120118
/* OF node does not contatin a 'reg' property to match to */
121119
return -EAGAIN;
122120

123-
of_node_addr = of_read_number(reg, of_n_addr_cells(np));
124-
125121
if (cell->of_reg != of_node_addr)
126122
/* No match */
127123
return -EAGAIN;

0 commit comments

Comments
 (0)