scripts/dts: Fix detection of a GPIO specifier

We should only assume a GPIO specifier is either named <FOO>-gpios or
gpios.  Any other form like ngpios should not be considered a GPIO
specifier.  especially since 'ngpios' is the standard property name for
the number of gpio's that are implemented.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-08-07 08:40:14 -05:00 committed by Kumar Gala
commit 8622c3415d
2 changed files with 2 additions and 2 deletions

View file

@ -1357,7 +1357,7 @@ def _gpios(node):
res = {}
for name, prop in node.props.items():
if name.endswith("gpios"):
if name.endswith("-gpios") or name == "gpios":
# Get the prefix from the property name:
# - gpios -> "" (deprecated, should have a prefix)
# - foo-gpios -> "foo"

View file

@ -84,7 +84,7 @@ def generate_prop_defines(node_path, prop):
compatible.extract(node_path, prop, def_label)
elif 'clocks' in prop:
clocks.extract(node_path, prop, def_label)
elif 'pwms' in prop or 'gpios' in prop:
elif 'pwms' in prop or '-gpios' in prop or prop == "gpios":
prop_values = reduced[node_path]['props'][prop]
generic = prop[:-1] # Drop the 's' from the prop