aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dtc/dtc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-05 22:33:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-05 22:33:07 -0400
commit3ef2bc099d1cce09e2844467e2ced98e1a44609d (patch)
treebe3d1ea5da1ba9f3a664d5da7f34574bb7930ce7 /scripts/dtc/dtc.c
parent2eecf3a49f1ff24c6116c954dd74e83f227fc716 (diff)
parent17a70355ea576843a7ac851f1db26872a50b2850 (diff)
Merge tag 'devicetree-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull DeviceTree updates from Rob Herring: - fix sparse warnings in drivers/of/ - add more overlay unittests - update dtc to v1.4.4-8-g756ffc4f52f6. This adds more checks on dts files such as unit-address formatting and stricter character sets for node and property names - add a common DT modalias function - move trivial-devices.txt up and out of i2c dir - ARM NVIC interrupt controller binding - vendor prefixes for Sensirion, Dioo, Nordic, ROHM - correct some binding file locations * tag 'devicetree-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (24 commits) of: fix sparse warnings in fdt, irq, reserved mem, and resolver code of: fix sparse warning in of_pci_range_parser_one of: fix sparse warnings in of_find_next_cache_node of/unittest: Missing unlocks on error of: fix uninitialized variable warning for overlay test of: fix unittest build without CONFIG_OF_OVERLAY of: Add unit tests for applying overlays of: per-file dtc compiler flags fpga: region: add missing DT documentation for config complete timeout of: Add vendor prefix for ROHM Semiconductor of: fix "/cpus" reference leak in of_numa_parse_cpu_nodes() of: Add vendor prefix for Nordic Semiconductor dt-bindings: arm,nvic: Binding for ARM NVIC interrupt controller on Cortex-M dtc: update warning settings for new bus and node/property name checks scripts/dtc: Update to upstream version v1.4.4-8-g756ffc4f52f6 scripts/dtc: automate getting dtc version and log in update script of: Add function for generating a DT modalias with a newline of: fix of_device_get_modalias returned length when truncating buffers Documentation: devicetree: move trivial-devices out of I2C realm dt-bindings: add vendor prefix for Dioo ..
Diffstat (limited to 'scripts/dtc/dtc.c')
-rw-r--r--scripts/dtc/dtc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/dtc/dtc.c b/scripts/dtc/dtc.c
index a4edf4c7aebf..f5eed9d72c02 100644
--- a/scripts/dtc/dtc.c
+++ b/scripts/dtc/dtc.c
@@ -138,7 +138,7 @@ static const char *guess_type_by_name(const char *fname, const char *fallback)
138static const char *guess_input_format(const char *fname, const char *fallback) 138static const char *guess_input_format(const char *fname, const char *fallback)
139{ 139{
140 struct stat statbuf; 140 struct stat statbuf;
141 uint32_t magic; 141 fdt32_t magic;
142 FILE *f; 142 FILE *f;
143 143
144 if (stat(fname, &statbuf) != 0) 144 if (stat(fname, &statbuf) != 0)
@@ -159,8 +159,7 @@ static const char *guess_input_format(const char *fname, const char *fallback)
159 } 159 }
160 fclose(f); 160 fclose(f);
161 161
162 magic = fdt32_to_cpu(magic); 162 if (fdt32_to_cpu(magic) == FDT_MAGIC)
163 if (magic == FDT_MAGIC)
164 return "dtb"; 163 return "dtb";
165 164
166 return guess_type_by_name(fname, fallback); 165 return guess_type_by_name(fname, fallback);
@@ -216,7 +215,7 @@ int main(int argc, char *argv[])
216 alignsize = strtol(optarg, NULL, 0); 215 alignsize = strtol(optarg, NULL, 0);
217 if (!is_power_of_2(alignsize)) 216 if (!is_power_of_2(alignsize))
218 die("Invalid argument \"%d\" to -a option\n", 217 die("Invalid argument \"%d\" to -a option\n",
219 optarg); 218 alignsize);
220 break; 219 break;
221 case 'f': 220 case 'f':
222 force = true; 221 force = true;
@@ -309,6 +308,8 @@ int main(int argc, char *argv[])
309 else 308 else
310 die("Unknown input format \"%s\"\n", inform); 309 die("Unknown input format \"%s\"\n", inform);
311 310
311 dti->outname = outname;
312
312 if (depfile) { 313 if (depfile) {
313 fputc('\n', depfile); 314 fputc('\n', depfile);
314 fclose(depfile); 315 fclose(depfile);