All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 2/3] net: Expose some errors generated in net_init
Date: Wed, 16 Sep 2020 19:09:48 -0600	[thread overview]
Message-ID: <CAPnjgZ0Z2tNd24YhZRJOvHydnZ4JyA+eXQtGNKXo+C4VqYQ=XQ@mail.gmail.com> (raw)
In-Reply-To: <20200912214544.362594-3-seanga2@gmail.com>

On Sat, 12 Sep 2020 at 15:46, Sean Anderson <seanga2@gmail.com> 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 <seanga2@gmail.com>
> ---
>
>  include/net.h    |  2 +-
>  net/eth-uclass.c |  3 +++
>  net/net.c        | 15 +++++++++++----
>  3 files changed, 15 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

  reply	other threads:[~2020-09-17  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-12 21:45 [PATCH 0/3] log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG Sean Anderson
2020-09-12 21:45 ` [PATCH 1/3] dev: Disambiguate errors in uclass_find Sean Anderson
2020-09-17  1:09   ` Simon Glass
2020-09-17  1:44     ` Sean Anderson
2020-09-17  3:44       ` Simon Glass
2020-09-12 21:45 ` [PATCH 2/3] net: Expose some errors generated in net_init Sean Anderson
2020-09-17  1:09   ` Simon Glass [this message]
2020-10-12  1:15   ` Tom Rini
2020-09-12 21:45 ` [PATCH 3/3] log: syslog: Handle errors " Sean Anderson
2020-09-17  1:09   ` Simon Glass
2020-10-12  1:15   ` Tom Rini
2020-09-13 20:13 ` [PATCH 0/3] log: Fix segfault in sandbox when LOG_LEVEL_DEFAULT >= LOGL_DEBUG Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPnjgZ0Z2tNd24YhZRJOvHydnZ4JyA+eXQtGNKXo+C4VqYQ=XQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.