From 5d695e27729179457a5f3b97f2c2613d35f69cca Mon Sep 17 00:00:00 2001
From: Nathaniel Graff <nathaniel.graff@sifive.com>
Date: Wed, 5 Jun 2019 11:38:20 -0700
Subject: fixup-dts takes first matching port

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
---
 scripts/fixup-dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/fixup-dts b/scripts/fixup-dts
index 278b835..835eeaf 100755
--- a/scripts/fixup-dts
+++ b/scripts/fixup-dts
@@ -129,7 +129,7 @@ if [ `grep -c 'sifive,testram0' ${dts}` -eq 0 ]; then
                 if [ `grep -c "${protocol}-${port_type}-port" ${dts}` -ne 0 ]; then
                     
                     # Build the node name
-                    port_node_name=`egrep -o "${protocol}-${port_type}-port@[a-fA-F0-9]+" ${dts}`
+                    port_node_name=`egrep -o "${protocol}-${port_type}-port@[a-fA-F0-9]+" ${dts} | head -n 1`
                     echo -e "$0: \tUsing node \t${port_node_name}"
 
                     # Get the address and size cells
-- 
cgit v1.2.3