提交 054abb51 编写于 作者: J Jakub Kicinski

tools: ynl: make definitions optional again

definitions are optional, commit in question breaks cli for ethtool.

Fixes: 6517a60b ("tools: ynl: move the enum classes to shared code")
Reviewed-by: NChuck Lever <chuck.lever@oracle.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 0d2be75c
...@@ -387,7 +387,8 @@ class SpecFamily(SpecElement): ...@@ -387,7 +387,8 @@ class SpecFamily(SpecElement):
def resolve(self): def resolve(self):
self.resolve_up(super()) self.resolve_up(super())
for elem in self.yaml['definitions']: definitions = self.yaml.get('definitions', [])
for elem in definitions:
if elem['type'] == 'enum' or elem['type'] == 'flags': if elem['type'] == 'enum' or elem['type'] == 'flags':
self.consts[elem['name']] = self.new_enum(elem) self.consts[elem['name']] = self.new_enum(elem)
else: else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册