gpio: shell: use the first nodelabel when available

Use the first nodelabel rather than the node name when available for
shell completion as well as "gpio info". This label is always set gpio
nodes as that's what's used for references by device nodes, there may be
some case where a node has multiple labels for some reason but for a
human I reckon it still makes more sense to suggest a label rather than
the address.

This means that the commands would use, for example "gpioa" rather than
"gpio@58020000".

Fall back to the normal node name if there's no label set or if dt
metadata is not enabled.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
1 file changed