Commit c3028b95 authored by Nicolas Saenz Julienne's avatar Nicolas Saenz Julienne Committed by Thomas Bogendoerfer

of: address: Fix parser address/size cells initialization

bus->count_cells() parses cells starting from the node's parent. This is
not good enough for parser_init() which is generally parsing a bus node.

Revert to previous behavior using of_bus_n_*_cells().

Fixes: 2f96593e ("of_address: Add bus type match for pci ranges parser")
Reported-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Acked-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 0fc0ead3
...@@ -701,11 +701,11 @@ static int parser_init(struct of_pci_range_parser *parser, ...@@ -701,11 +701,11 @@ static int parser_init(struct of_pci_range_parser *parser,
parser->node = node; parser->node = node;
parser->pna = of_n_addr_cells(node); parser->pna = of_n_addr_cells(node);
parser->na = of_bus_n_addr_cells(node);
parser->ns = of_bus_n_size_cells(node);
parser->dma = !strcmp(name, "dma-ranges"); parser->dma = !strcmp(name, "dma-ranges");
parser->bus = of_match_bus(node); parser->bus = of_match_bus(node);
parser->bus->count_cells(parser->node, &parser->na, &parser->ns);
parser->range = of_get_property(node, name, &rlen); parser->range = of_get_property(node, name, &rlen);
if (parser->range == NULL) if (parser->range == NULL)
return -ENOENT; return -ENOENT;
......
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