aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2020-09-12 17:45:43 -0400
committerTom Rini <trini@konsulko.com>2020-10-10 16:50:12 -0400
commitc3f0278e29ffae81dc24c997523a8eafba503a0c (patch)
tree77305ef1b8c3f27d47976e79ca19057f69b00f17 /include
parentc7f5b850344b1bb620f603ab7df3ee92e1fa26cf (diff)
downloadu-boot-c3f0278e29ffae81dc24c997523a8eafba503a0c.zip
u-boot-c3f0278e29ffae81dc24c997523a8eafba503a0c.tar.gz
u-boot-c3f0278e29ffae81dc24c997523a8eafba503a0c.tar.bz2
net: Expose some errors generated in net_init
net_init does not always succeed, and there is no existing mechanism to discover errors. This patch allows callers of net_init (such as net_init) to handle errors. The root issue is that eth_get_dev can fail, but net_init_loop doesn't expose that. The ideal way to fix eth_get_dev would be to return an error with ERR_PTR, but there are a lot of callers, and all of them just check if it's NULL. Another approach would be to change the signature to something like int eth_get_dev(struct udevice **pdev) but that would require rewriting all of the many callers. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/net.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net.h b/include/net.h
index 2191071..778acf7 100644
--- a/include/net.h
+++ b/include/net.h
@@ -593,7 +593,7 @@ extern int net_ntp_time_offset; /* offset time from UTC */
#endif
/* Initialize the network adapter */
-void net_init(void);
+int net_init(void);
int net_loop(enum proto_t);
/* Load failed. Start again. */