summaryrefslogtreecommitdiff
path: root/tools/dtoc/dtb_platdata.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-29 06:34:48 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:26:35 +0300
commitf62cea0e205c905632be3aefa82b10ef36ce8a25 (patch)
tree8057b53a42d1f148c8704173282bbced8a132d82 /tools/dtoc/dtb_platdata.py
parent67b5ec54a5c19452c7aa33c693f281cc18a37d09 (diff)
downloadu-boot-f62cea0e205c905632be3aefa82b10ef36ce8a25.tar.xz
dtoc: Use None to mean stdout
At present dtoc uses '-' internally to mean that output should go to stdout. This is not necessary and None is more convenient. Update it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtb_platdata.py')
-rw-r--r--tools/dtoc/dtb_platdata.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 5b1bb7e5fd..118b1a5f43 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -237,12 +237,12 @@ class DtbPlatdata():
file.
Args:
- fname (str): Filename to send output to, or '-' for stdout
+ fname (str): Filename to send output to, or None for stdout
"""
- if fname == '-':
- self._outfile = sys.stdout
- else:
+ if fname:
self._outfile = open(fname, 'w')
+ else:
+ self._outfile = sys.stdout
def out(self, line):
"""Output a string to the output file
@@ -765,7 +765,7 @@ def run_steps(args, dtb_file, include_disabled, output, warning_disabled=False,
args (list): List of non-option arguments provided to the problem
dtb_file (str): Filename of dtb file to process
include_disabled (bool): True to include disabled nodes
- output (str): Name of output file
+ output (str): Name of output file (None for stdout)
warning_disabled (bool): True to avoid showing warnings about missing
drivers
drivers_additional (list): List of additional drivers to use during