For NET_LWIP eth_is_on_demand_init() is always 1 so remove the check and
simplify the code.

Suggested-by: Jerome Forissier <jerome.foriss...@linaro.org>
Signed-off-by: Tim Harvey <thar...@gateworks.com>
---
 net/lwip/net-lwip.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c
index d53faa39ba11..660ceb10cbe2 100644
--- a/net/lwip/net-lwip.c
+++ b/net/lwip/net-lwip.c
@@ -184,16 +184,12 @@ int net_lwip_eth_start(void)
        int ret;
 
        net_init();
-       if (eth_is_on_demand_init()) {
+       eth_halt();
+       eth_set_current();
+       ret = eth_init();
+       if (ret < 0) {
                eth_halt();
-               eth_set_current();
-               ret = eth_init();
-               if (ret < 0) {
-                       eth_halt();
-                       return ret;
-               }
-       } else {
-               eth_init_state_only();
+               return ret;
        }
 
        return 0;
-- 
2.25.1

Reply via email to