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:
Jordan Yates 2024-05-30 15:29:53 +10:00 committed by Johan Hedberg
parent 1264a9a163
commit ae25d606c9

View File

@ -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)}: