From: Simon Glass <sjg@chromium.org>
Date: Wed, 21 Aug 2024 16:18:58 +0000 (-0600)
Subject: arm: friendlyarm: Avoid accessing global_data fb_base
X-Git-Tag: v2025.01-rc5-pxa1908~170^2~69^2~32
X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=54a221d2cdf521bffd433ee52e33c83b00d2bfe6;p=u-boot.git

arm: friendlyarm: Avoid accessing global_data fb_base

Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/board/friendlyarm/nanopi2/board.c b/board/friendlyarm/nanopi2/board.c
index c8cbc5a15f..b32dfc6b57 100644
--- a/board/friendlyarm/nanopi2/board.c
+++ b/board/friendlyarm/nanopi2/board.c
@@ -11,6 +11,7 @@
 #ifdef CONFIG_PWM_NX
 #include <pwm.h>
 #endif
+#include <video.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 
@@ -492,12 +493,8 @@ int splash_screen_prepare(void)
 					 ARRAY_SIZE(splash_locations));
 	}
 
-	if (!err) {
-		char addr[64];
-
-		sprintf(addr, "0x%lx", gd->fb_base);
-		env_set("fb_addr", addr);
-	}
+	if (!err)
+		env_set_hex("fb_addr", video_get_fb());
 
 	return err;
 }