[PATCH 2/2] rockchip: misc: Don't fail if ethaddr is already set

Paul Kocialkowski paul.kocialkowski at bootlin.com
Tue Dec 3 16:46:32 CET 2019


rockchip_setup_macaddr will return -1 if ethaddr is already set, which
gets propagated to misc_init_r and eventually halts the boot process.

While checking that the variable is not already set before attempting to
setit  is legitimate (it's a set-once variable), this is no good reason
to halt the boot process.

Return the success return code if the variable is already set instead.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski at bootlin.com>
---
 arch/arm/mach-rockchip/misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/misc.c b/arch/arm/mach-rockchip/misc.c
index a0c6a1c0b266..bce10bb04f8f 100644
--- a/arch/arm/mach-rockchip/misc.c
+++ b/arch/arm/mach-rockchip/misc.c
@@ -29,7 +29,7 @@ int rockchip_setup_macaddr(void)
 
 	/* Only generate a MAC address, if none is set in the environment */
 	if (env_get("ethaddr"))
-		return -1;
+		return 0;
 
 	if (!cpuid) {
 		debug("%s: could not retrieve 'cpuid#'\n", __func__);
-- 
2.24.0



More information about the U-Boot mailing list