Set the correct default for #address-cells variable when the property does

not exist.

This has never caused any issue because #address-cells is mandatory.

Sponsored by:	Rubicon Communications, LLC (Netgate)
MFC after:	2 weeks
This commit is contained in:
Luiz Otavio O Souza 2017-04-30 07:31:48 +00:00
parent c4f2941e0b
commit 948dad6add
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317604

View File

@ -422,7 +422,7 @@ fdt_addrsize_cells(phandle_t node, int *addr_cells, int *size_cells)
*/
cell_size = sizeof(cell);
if (OF_getencprop(node, "#address-cells", &cell, cell_size) < cell_size)
*addr_cells = 2;
cell = 2;
*addr_cells = (int)cell;
if (OF_getencprop(node, "#size-cells", &cell, cell_size) < cell_size)