fdt_rw.c (204488) | fdt_rw.c (238742) |
---|---|
1/* 2 * libfdt - Flat Device Tree manipulation 3 * Copyright (C) 2006 David Gibson, IBM Corporation. 4 * 5 * libfdt is dual licensed: you can use it either under the terms of 6 * the GPL, or the BSD license, at your option. 7 * 8 * a) This library is free software; you can redistribute it and/or --- 275 unchanged lines hidden (view full) --- 284 err = _fdt_add_property(fdt, nodeoffset, name, len, &prop); 285 if (err) 286 return err; 287 288 memcpy(prop->data, val, len); 289 return 0; 290} 291 | 1/* 2 * libfdt - Flat Device Tree manipulation 3 * Copyright (C) 2006 David Gibson, IBM Corporation. 4 * 5 * libfdt is dual licensed: you can use it either under the terms of 6 * the GPL, or the BSD license, at your option. 7 * 8 * a) This library is free software; you can redistribute it and/or --- 275 unchanged lines hidden (view full) --- 284 err = _fdt_add_property(fdt, nodeoffset, name, len, &prop); 285 if (err) 286 return err; 287 288 memcpy(prop->data, val, len); 289 return 0; 290} 291 |
292int fdt_appendprop(void *fdt, int nodeoffset, const char *name, 293 const void *val, int len) 294{ 295 struct fdt_property *prop; 296 int err, oldlen, newlen; 297 298 FDT_RW_CHECK_HEADER(fdt); 299 300 prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen); 301 if (prop) { 302 newlen = len + oldlen; 303 err = _fdt_splice_struct(fdt, prop->data, 304 FDT_TAGALIGN(oldlen), 305 FDT_TAGALIGN(newlen)); 306 if (err) 307 return err; 308 prop->len = cpu_to_fdt32(newlen); 309 memcpy(prop->data + oldlen, val, len); 310 } else { 311 err = _fdt_add_property(fdt, nodeoffset, name, len, &prop); 312 if (err) 313 return err; 314 memcpy(prop->data, val, len); 315 } 316 return 0; 317} 318 |
|
292int fdt_delprop(void *fdt, int nodeoffset, const char *name) 293{ 294 struct fdt_property *prop; 295 int len, proplen; 296 297 FDT_RW_CHECK_HEADER(fdt); 298 299 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); --- 166 unchanged lines hidden --- | 319int fdt_delprop(void *fdt, int nodeoffset, const char *name) 320{ 321 struct fdt_property *prop; 322 int len, proplen; 323 324 FDT_RW_CHECK_HEADER(fdt); 325 326 prop = fdt_get_property_w(fdt, nodeoffset, name, &len); --- 166 unchanged lines hidden --- |