Consolidate utilfdt_read_len() variants
There are no less than _four_ variants on utilfdt_read() which is a bit
excessive. The _len() variants are particularly pointless, since we can
achieve the same thing with very little extra verbosity by using the usual
convention of ignoring return parameters if they're NULL. So, get rid of
them (we keep the shorter names without _len, but add now-optional len
parameters).
Signed-off-by: David Gibson <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Tested-by: Alexey Kardashevskiy <[email protected]>
Reviewed-by: Alexey Kardashevskiy <[email protected]>
diff --git a/fdtoverlay.c b/fdtoverlay.c
index 62a942d..2a2c89c 100644
--- a/fdtoverlay.c
+++ b/fdtoverlay.c
@@ -63,7 +63,7 @@
off_t blob_len, ov_len, total_len;
int i, ret = -1;
- blob = utilfdt_read_len(input_filename, &blob_len);
+ blob = utilfdt_read(input_filename, &blob_len);
if (!blob) {
fprintf(stderr, "\nFailed to read base blob %s\n",
input_filename);
@@ -84,7 +84,7 @@
/* read and keep track of the overlay blobs */
total_len = 0;
for (i = 0; i < argc; i++) {
- ovblob[i] = utilfdt_read_len(argv[i], &ov_len);
+ ovblob[i] = utilfdt_read(argv[i], &ov_len);
if (!ovblob[i]) {
fprintf(stderr, "\nFailed to read overlay %s\n",
argv[i]);