From df949b3ca21b452f975b9b093ac233cf669477ee Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 10 Nov 2017 19:45:32 +0100 Subject: [PATCH] all devices don't have hex prefix, e.g. lirc module --- gpio.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gpio.pl b/gpio.pl index a681156..429982b 100755 --- a/gpio.pl +++ b/gpio.pl @@ -83,8 +83,9 @@ my $device; open(my $fh, '<', $opt_read . '/sys/kernel/debug/pinctrl/pinctrl-handles'); while(<$fh>) { chomp; - if ( m/device: [0-9a-f]+\.(\w+)/ ) { + if ( m/device: (\S+)/ ) { $device = $1; + $device =~ s/^[0-9a-f]*\.//; # remove hex address } elsif ( m/group: (\w+\d+)\s.+function: (\S+)/ ) { my ($pin, $function) = ($1,$2); $pin_function->{$pin} = "$device $function"; -- 2.20.1