aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dtc/dtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/dtc/dtc.c')
-rw-r--r--scripts/dtc/dtc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index e3c96536fd9d..8c4add69a765 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -48,6 +48,8 @@ static void fill_fullpaths(struct node *tree, const char *prefix)
48} 48}
49 49
50/* Usage related data. */ 50/* Usage related data. */
51#define FDT_VERSION(version) _FDT_VERSION(version)
52#define _FDT_VERSION(version) #version
51static const char usage_synopsis[] = "dtc [options] <input file>"; 53static const char usage_synopsis[] = "dtc [options] <input file>";
52static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv"; 54static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv";
53static struct option const usage_long_opts[] = { 55static struct option const usage_long_opts[] = {
@@ -82,9 +84,9 @@ static const char * const usage_opts_help[] = {
82 "\t\tdts - device tree source text\n" 84 "\t\tdts - device tree source text\n"
83 "\t\tdtb - device tree blob\n" 85 "\t\tdtb - device tree blob\n"
84 "\t\tasm - assembler source", 86 "\t\tasm - assembler source",
85 "\n\tBlob version to produce, defaults to %d (for dtb and asm output)", //, DEFAULT_FDT_VERSION); 87 "\n\tBlob version to produce, defaults to "FDT_VERSION(DEFAULT_FDT_VERSION)" (for dtb and asm output)",
86 "\n\tOutput dependency file", 88 "\n\tOutput dependency file",
87 "\n\ttMake space for <number> reserve map entries (for dtb and asm output)", 89 "\n\tMake space for <number> reserve map entries (for dtb and asm output)",
88 "\n\tMake the blob at least <bytes> long (extra space)", 90 "\n\tMake the blob at least <bytes> long (extra space)",
89 "\n\tAdd padding to the blob of <bytes> long (extra space)", 91 "\n\tAdd padding to the blob of <bytes> long (extra space)",
90 "\n\tSet the physical boot cpu", 92 "\n\tSet the physical boot cpu",
@@ -109,7 +111,7 @@ int main(int argc, char *argv[])
109 const char *outform = "dts"; 111 const char *outform = "dts";
110 const char *outname = "-"; 112 const char *outname = "-";
111 const char *depname = NULL; 113 const char *depname = NULL;
112 int force = 0, sort = 0; 114 bool force = false, sort = false;
113 const char *arg; 115 const char *arg;
114 int opt; 116 int opt;
115 FILE *outf = NULL; 117 FILE *outf = NULL;
@@ -148,7 +150,7 @@ int main(int argc, char *argv[])
148 padsize = strtol(optarg, NULL, 0); 150 padsize = strtol(optarg, NULL, 0);
149 break; 151 break;
150 case 'f': 152 case 'f':
151 force = 1; 153 force = true;
152 break; 154 break;
153 case 'q': 155 case 'q':
154 quiet++; 156 quiet++;
@@ -174,7 +176,7 @@ int main(int argc, char *argv[])
174 break; 176 break;
175 177
176 case 's': 178 case 's':
177 sort = 1; 179 sort = true;
178 break; 180 break;
179 181
180 case 'W': 182 case 'W':
@@ -237,7 +239,7 @@ int main(int argc, char *argv[])
237 if (streq(outname, "-")) { 239 if (streq(outname, "-")) {
238 outf = stdout; 240 outf = stdout;
239 } else { 241 } else {
240 outf = fopen(outname, "w"); 242 outf = fopen(outname, "wb");
241 if (! outf) 243 if (! outf)
242 die("Couldn't open output file %s: %s\n", 244 die("Couldn't open output file %s: %s\n",
243 outname, strerror(errno)); 245 outname, strerror(errno));