doc: _scripts: gen_devicetree_rest: skip empty vendors
Don't create output sections for vendors without bindings. This only affects the `Unknown vendor` and `Generic or vendor-independent` vendors, which are populated by default but do not necessarily contain any entries. Signed-off-by: Jordan Yates <jordan@embeint.com>
This commit is contained in:
parent
1264a9a163
commit
ae25d606c9
@ -322,7 +322,9 @@ def write_bindings_rst(vnd_lookup, out_dir):
|
||||
.. rst-class:: rst-columns
|
||||
''', string_io)
|
||||
|
||||
for vnd in vnd_lookup.vnd2bindings:
|
||||
for vnd, bindings in vnd_lookup.vnd2bindings.items():
|
||||
if len(bindings) == 0:
|
||||
continue
|
||||
print(f'- :ref:`{vnd_lookup.target(vnd)}`', file=string_io)
|
||||
|
||||
print_block('''\
|
||||
@ -358,6 +360,9 @@ def write_bindings_rst(vnd_lookup, out_dir):
|
||||
title += f' ({vnd})'
|
||||
underline = '=' * len(title)
|
||||
|
||||
if len(bindings) == 0:
|
||||
continue
|
||||
|
||||
print_block(f'''\
|
||||
.. _{vnd_lookup.target(vnd)}:
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user