int fdt_next_property_offset(const void *fdt, int offset) { if ((offset = _fdt_check_prop_offset(fdt, offset)) < 0) return offset; return _nextprop(fdt, offset); }
const struct fdt_property *fdt_get_property_by_offset(const void *fdt, int offset, int *lenp) { int err; const struct fdt_property *prop; if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) { if (lenp) *lenp = err; return NULL; } prop = _fdt_offset_ptr(fdt, offset); if (lenp) *lenp = fdt32_to_cpu(prop->len); return prop; }
/* * offset: propert의 offset * lenp: propert내의 value 길이 저장 * offset을 이용하여 property에 접근 및 property 구조체와, value 길이를 받아옴 */ const struct fdt_property *fdt_get_property_by_offset(const void *fdt, int offset, int *lenp) { int err; const struct fdt_property *prop; // property의 유효성을 체크 if ((err = _fdt_check_prop_offset(fdt, offset)) < 0) { if (lenp) *lenp = err; return NULL; } // property 구조체를 가져옴 prop = _fdt_offset_ptr(fdt, offset); // property의 value의 길이 저장 if (lenp) *lenp = fdt32_to_cpu(prop->len); return prop; }