Message ID | 20191203154632.340463-2-paul.kocialkowski@bootlin.com |
---|---|
State | Accepted |
Commit | d490fadc703c54f61e6ba8f47dfd7a4702ac2293 |
Delegated to: | Kever Yang |
Headers | show |
Series | [1/2] rockchip: misc: Only assign serial# variable if unset | expand |
On 03.12.19 16:46, Paul Kocialkowski wrote: > 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@bootlin.com> Same as "rockchip: misc: don't fail if eth_addr already set" from november 29 ;-) > --- > 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__);
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__);
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@bootlin.com> --- arch/arm/mach-rockchip/misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)