projects
/
linux-gpio-pinout
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b329cd1
)
shorten duplicate kernel device/function
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 10 Nov 2017 14:49:02 +0000
(15:49 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Fri, 10 Nov 2017 14:49:02 +0000
(15:49 +0100)
gpio.pl
patch
|
blob
|
history
diff --git
a/gpio.pl
b/gpio.pl
index
e26e23a
..
3a2bf39
100755
(executable)
--- a/
gpio.pl
+++ b/
gpio.pl
@@
-110,6
+110,10
@@
foreach my $line (@lines) {
$line =~ s/(\[spi)([^\t]*\]\s[^\t]*(miso|mosi|s?clk|c[se]\d*))/$1 $3$2/gi;
$line =~ s/\s*\([^\)]+\)//g if ! $opt_alt;
+ # shorten duplicate kernel device/function
+ $line =~ s/\[serial (\w+) (uart\d+)\]/[$2 $1]/g;
+ $line =~ s/\[(\w+) (\w+) \1(\d+)\]/[$1$3 $2]/g;
+
my @v = split(/\s*\t+\s*/,$line,4);
push @line_parts, [ @v ];
foreach my $i ( 0 .. 3 ) {