| #!/bin/bash |
| i_file="$1" |
| dts="$2" |
| |
| # Map out all of the pins from the pre-processed file |
| declare -A i_pins |
| while read -r pin; do |
| i_pins["$pin"]=1 |
| done < <(sed -n '/{ .number = [0-9]*, .name = /s,.*"\([^"]*\)".*,\1,p' "$i_file") |
| rc=0 |
| |
| # For each pin in the dtsi, make sure the string exists in the source code |
| # Otherwise, we will have silent pin mapping issues at runtime |
| while read -r pin; do |
| if [ -z "${i_pins["$pin"]-}" ]; then |
| echo "Missing pin: $pin" >&2 |
| rc=1 |
| fi |
| done < <(grep 'pins = ' "$dts" | sed 's,.*"\(.*\)".*,\1,') |
| exit $rc |