1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

fdt: Update functions which write to an FDT to return -ENOSPC

When writing values into an FDT it is possible that there will be
insufficient space. If the caller gets a useful error then it can
potentially deal with the situation.

Adjust these functions to return -ENOSPC when the FDT is full.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2014-06-02 22:04:51 -06:00
committed by Tom Rini
parent 63b4b5bae5
commit 4f427a421f
3 changed files with 23 additions and 12 deletions

View File

@@ -833,7 +833,7 @@ static int fit_image_hash_get_ignore(const void *fit, int noffset, int *ignore)
*
* returns:
* 0, on success
* -1, on property read failure
* -ENOSPC if no space in device tree, -1 for other error
*/
int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
{
@@ -847,7 +847,7 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
printf("Can't set '%s' property for '%s' node (%s)\n",
FIT_TIMESTAMP_PROP, fit_get_name(fit, noffset, NULL),
fdt_strerror(ret));
return -1;
return ret == -FDT_ERR_NOSPACE ? -ENOSPC : -1;
}
return 0;