mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-09-14 08:36:46 +10:00
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>
This commit is contained in:
parent
7c81582c0b
commit
c7fe3bbfd6
@ -102,7 +102,6 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
|
|||||||
{
|
{
|
||||||
#if IS_ENABLED(CONFIG_OF)
|
#if IS_ENABLED(CONFIG_OF)
|
||||||
struct mfd_of_node_entry *of_entry;
|
struct mfd_of_node_entry *of_entry;
|
||||||
const __be32 *reg;
|
|
||||||
u64 of_node_addr;
|
u64 of_node_addr;
|
||||||
|
|
||||||
/* Skip if OF node has previously been allocated to a device */
|
/* 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,
|
|||||||
goto allocate_of_node;
|
goto allocate_of_node;
|
||||||
|
|
||||||
/* We only care about each node's first defined address */
|
/* We only care about each node's first defined address */
|
||||||
reg = of_get_address(np, 0, NULL, NULL);
|
if (of_property_read_reg(np, 0, &of_node_addr, NULL))
|
||||||
if (!reg)
|
|
||||||
/* OF node does not contatin a 'reg' property to match to */
|
/* OF node does not contatin a 'reg' property to match to */
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
|
||||||
of_node_addr = of_read_number(reg, of_n_addr_cells(np));
|
|
||||||
|
|
||||||
if (cell->of_reg != of_node_addr)
|
if (cell->of_reg != of_node_addr)
|
||||||
/* No match */
|
/* No match */
|
||||||
return -EAGAIN;
|
return -EAGAIN;
|
||||||
|
Loading…
Reference in New Issue
Block a user