[PATCH 01/12] tegra: beaver: set hostname in board init

Lucas Stach dev at lynxeye.de
Mon Nov 3 14:52:13 PST 2014


Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 arch/arm/boards/nvidia-beaver/board.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boards/nvidia-beaver/board.c b/arch/arm/boards/nvidia-beaver/board.c
index 20707d8..d270301 100644
--- a/arch/arm/boards/nvidia-beaver/board.c
+++ b/arch/arm/boards/nvidia-beaver/board.c
@@ -20,7 +20,7 @@
 #include <i2c/i2c.h>
 #include <init.h>
 
-static int nvidia_beaver_devices_init(void)
+static int nvidia_beaver_fs_init(void)
 {
 	struct i2c_client client;
 	u8 data;
@@ -44,4 +44,15 @@ static int nvidia_beaver_devices_init(void)
 
 	return 0;
 }
-fs_initcall(nvidia_beaver_devices_init);
+fs_initcall(nvidia_beaver_fs_init);
+
+static int nvidia_beaver_device_init(void)
+{
+	if (!of_machine_is_compatible("nvidia,beaver"))
+		return 0;
+
+	barebox_set_hostname("beaver");
+
+	return 0;
+}
+device_initcall(nvidia_beaver_device_init);
-- 
1.9.3




More information about the barebox mailing list