56#include "libfdt_internal.h"
68 ac = fdt_getprop (fdt, nodeoffset,
"#address-cells", &len);
73 if (len !=
sizeof (*ac)) {
74 return -FDT_ERR_BADNCELLS;
77 val = fdt32_to_cpu (*ac);
78 if ((val <= 0) || (val > FDT_MAX_NCELLS)) {
79 return -FDT_ERR_BADNCELLS;
95 sc = fdt_getprop (fdt, nodeoffset,
"#size-cells", &len);
100 if (len !=
sizeof (*sc)) {
101 return -FDT_ERR_BADNCELLS;
104 val = fdt32_to_cpu (*sc);
105 if ((val < 0) || (val > FDT_MAX_NCELLS)) {
106 return -FDT_ERR_BADNCELLS;