[U-Boot] [PATCH V2 06/12] board: keymile: Move common headers to board-common directory

Nishanth Menon nm at ti.com
Fri Nov 13 06:43:36 CET 2015


Header files can be located in a generic location without
needing to reference them with ../common/

Generated with the following script

 #!/bin/bash
vendor=board/keymile
common=$vendor/common

cfiles=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep c$`
headers=`git grep "../common" $vendor|grep "#include"|cut -d '"' -f2|sort -u|grep h$`

mkdir -p $common/include/board-common
set -x
for header in $headers
do
	echo "processing $header in $common"
	hbase=`basename $header`
	git mv $common/$hbase $common/include/board-common
	sed -i -e "s/\"..\/common\/$hbase\"/<board-common\/$hbase>/g" $vendor/*/*.[chS]
	sed -i -e "s/\"$hbase\"/<board-common\/$hbase>/g" $vendor/common/*.[chS]
done

Cc: Valentin Longchamp <valentin.longchamp at keymile.com>
Cc: Holger Brunck <holger.brunck at keymile.com>

Signed-off-by: Nishanth Menon <nm at ti.com>
---
 board/keymile/common/common.c                            | 2 +-
 board/keymile/common/{ => include/board-common}/common.h | 0
 board/keymile/common/ivm.c                               | 2 +-
 board/keymile/km82xx/km82xx.c                            | 2 +-
 board/keymile/km83xx/km83xx.c                            | 2 +-
 board/keymile/km83xx/km83xx_i2c.c                        | 2 +-
 board/keymile/km_arm/km_arm.c                            | 2 +-
 board/keymile/kmp204x/kmp204x.c                          | 2 +-
 board/keymile/kmp204x/qrio.c                             | 2 +-
 9 files changed, 8 insertions(+), 8 deletions(-)
 rename board/keymile/common/{ => include/board-common}/common.h (100%)

diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
index b9aff1a84dcb..4f8b68ee5ccd 100644
--- a/board/keymile/common/common.c
+++ b/board/keymile/common/common.c
@@ -21,7 +21,7 @@
 #if defined(CONFIG_POST)
 #include "post.h"
 #endif
-#include "common.h"
+#include <board-common/common.h>
 #include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/keymile/common/common.h b/board/keymile/common/include/board-common/common.h
similarity index 100%
rename from board/keymile/common/common.h
rename to board/keymile/common/include/board-common/common.h
diff --git a/board/keymile/common/ivm.c b/board/keymile/common/ivm.c
index 42db54221bb3..4d2963ad5f84 100644
--- a/board/keymile/common/ivm.c
+++ b/board/keymile/common/ivm.c
@@ -8,7 +8,7 @@
 #include <common.h>
 #include <cli_hush.h>
 #include <i2c.h>
-#include "common.h"
+#include <board-common/common.h>
 
 #define MAC_STR_SZ	20
 
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index c599b4093626..73d22dc6ac19 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -16,7 +16,7 @@
 #endif
 
 #include <i2c.h>
-#include "../common/common.h"
+#include <board-common/common.h>
 
 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
 
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 89e9e1e57c38..83deca56aebc 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -26,7 +26,7 @@
 #include <libfdt.h>
 #include <post.h>
 
-#include "../common/common.h"
+#include <board-common/common.h>
 
 static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
 
diff --git a/board/keymile/km83xx/km83xx_i2c.c b/board/keymile/km83xx/km83xx_i2c.c
index c961937530ac..e702a5cf86e2 100644
--- a/board/keymile/km83xx/km83xx_i2c.c
+++ b/board/keymile/km83xx/km83xx_i2c.c
@@ -9,7 +9,7 @@
 #include <i2c.h>
 #include <asm/io.h>
 #include <linux/ctype.h>
-#include "../common/common.h"
+#include <board-common/common.h>
 
 static void i2c_write_start_seq(void)
 {
diff --git a/board/keymile/km_arm/km_arm.c b/board/keymile/km_arm/km_arm.c
index 2938861f368f..82fa31c2208d 100644
--- a/board/keymile/km_arm/km_arm.c
+++ b/board/keymile/km_arm/km_arm.c
@@ -23,7 +23,7 @@
 #include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 
-#include "../common/common.h"
+#include <board-common/common.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index eebb47fc21f1..fbe6d98af6ce 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -21,7 +21,7 @@
 #include <asm/fsl_liodn.h>
 #include <fm_eth.h>
 
-#include "../common/common.h"
+#include <board-common/common.h>
 #include "kmp204x.h"
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/keymile/kmp204x/qrio.c b/board/keymile/kmp204x/qrio.c
index edf3bf11a894..a4c25e084846 100644
--- a/board/keymile/kmp204x/qrio.c
+++ b/board/keymile/kmp204x/qrio.c
@@ -7,7 +7,7 @@
 
 #include <common.h>
 
-#include "../common/common.h"
+#include <board-common/common.h>
 #include "kmp204x.h"
 
 /* QRIO GPIO register offsets */
-- 
2.6.2.402.g2635c2b


More information about the U-Boot mailing list