skip pins missing from pintctrl
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 18 Apr 2018 07:52:21 +0000 (07:52 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 18 Apr 2018 07:52:21 +0000 (07:52 +0000)
on rpi3, this is the case for activity led which is connected
to videocore and is not visible in kernel (sigh)

gpio.pl

diff --git a/gpio.pl b/gpio.pl
index f653c3f..3a31ade 100755 (executable)
--- a/gpio.pl
+++ b/gpio.pl
@@ -181,10 +181,13 @@ while(<$gpio_fh>) {
                my @l = split(/\s*[\(\|\)]\s*/, $_);
                warn "XXX ", dump( \@l );
                if ( $l[0] =~ m/gpio-(\d+)/ ) {
                my @l = split(/\s*[\(\|\)]\s*/, $_);
                warn "XXX ", dump( \@l );
                if ( $l[0] =~ m/gpio-(\d+)/ ) {
-                       my $pin = $linux_gpio_name->{$1} || die "can't find $1 in ",dump( $linux_gpio_name );
-                       $gpio_debug->{ $pin } = $l[2];
-                       $l[3] =~ s/\s\s+/ /g;
-                       annotate_pin $pin, qq{"$l[2]" $l[3]};
+                       if ( my $pin = $linux_gpio_name->{$1} ) {
+                               $gpio_debug->{ $pin } = $l[2];
+                               $l[3] =~ s/\s\s+/ /g;
+                               annotate_pin $pin, qq{"$l[2]" $l[3]};
+                       } else {
+                               warn "FIXME can't find $1 in ",dump( $linux_gpio_name );
+                       }
                }
        }
 
                }
        }