Commit 9723c25f authored by Tyrel Datwyler's avatar Tyrel Datwyler Committed by Michael Ellerman

PCI: rpaphp: Fix up pointer to first drc-info entry

The first entry of the ibm,drc-info property is an int encoded count
of the number of drc-info entries that follow. The "value" pointer
returned by of_prop_next_u32() is still pointing at the this value
when we call of_read_drc_info_cell(), but the helper function
expects that value to be pointing at the first element of an entry.

Fix up by incrementing the "value" pointer to point at the first
element of the first drc-info entry prior.
Signed-off-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1573449697-5448-5-git-send-email-tyreld@linux.ibm.com
parent b015f6bc
...@@ -239,6 +239,8 @@ static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name, ...@@ -239,6 +239,8 @@ static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name,
value = of_prop_next_u32(info, NULL, &entries); value = of_prop_next_u32(info, NULL, &entries);
if (!value) if (!value)
return -EINVAL; return -EINVAL;
else
value++;
for (j = 0; j < entries; j++) { for (j = 0; j < entries; j++) {
of_read_drc_info_cell(&info, &value, &drc); of_read_drc_info_cell(&info, &value, &drc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment