rockchip: misc: don't fail if eth_addr already set
authorHeiko Stuebner <heiko.stuebner@theobroma-systems.com>
Fri, 29 Nov 2019 15:40:42 +0000 (16:40 +0100)
committerKever Yang <kever.yang@rock-chips.com>
Thu, 5 Dec 2019 15:53:07 +0000 (23:53 +0800)
rockchip_setup_macaddr() runs from an initcall, so returning an error
code will make that initcall fail thus breaking the boot process.

And if an ethernet address is already set this is definitly not a
cause for that, so just return success in that case.

Fixes: 04825384999f ("rockchip: rk3399: derive ethaddr from cpuid");
Signed-off-by: Heiko Stuebner <heiko.stuebner@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
arch/arm/mach-rockchip/misc.c

index f697e937c6240114745255d6d52352e92837eacd..546377e61d9989022ed568d2aff4e600458a04a9 100644 (file)
@@ -30,7 +30,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__);