From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Sun, 11 Oct 2020 21:15:12 -0400 Subject: [PATCH 2/3] net: Expose some errors generated in net_init In-Reply-To: <20200912214544.362594-3-seanga2@gmail.com> References: <20200912214544.362594-1-seanga2@gmail.com> <20200912214544.362594-3-seanga2@gmail.com> Message-ID: <20201012011512.GR14816@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sat, Sep 12, 2020 at 05:45:43PM -0400, Sean Anderson wrote: > 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 > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: