All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuzmichev <vkuzmichev@mvista.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb_ether: register usb ethernet gadget at each eth init
Date: Fri, 26 Nov 2010 21:23:06 +0300	[thread overview]
Message-ID: <4CEFFB0A.3080804@mvista.com> (raw)
In-Reply-To: <1290741661-28108-1-git-send-email-leiwen@marvell.com>

Hi Lei,

Lei Wen wrote:
> Since the ether may not be the only one usb gadget would be used
> in the uboot, it is neccessary to do the register each time the
> eth begin to work to make usb gadget driver less confussed when
> we want to use two different usb gadget at the same time.
> [...]
> @@ -1788,6 +1788,8 @@ static int usb_eth_init(struct eth_device *netdev, bd_t *bd)
>  		error("received NULL ptr");
>  		goto fail;
>  	}
> +	if (usb_gadget_register_driver(&eth_driver) < 0)
> +		goto fail;

You probably need then at least to remove usb_gadget_register_driver
call from usb_eth_initialize. And add usb_gadget_unregister_driver in
usb_eth_halt.
For example, my UDC driver returns EBUSY if another gadget driver tries
to register itself. (Yes, I do not want to have more than 1 gadget).
With your patch the gadget driver will fail each time when initializing.
Anyway if I "fix" my UDC driver some day the Ether gadget will try to
register itself twice (and more times later). So I will have to protect
it against this bad behavior.

  reply	other threads:[~2010-11-26 18:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-26  3:21 [U-Boot] [PATCH] usb_ether: register usb ethernet gadget at each eth init Lei Wen
2010-11-26 18:23 ` Vitaly Kuzmichev [this message]
2010-11-27 14:21   ` Lei Wen
2010-11-29 13:56     ` Vitaly Kuzmichev
2010-11-29 14:06       ` Vitaly Kuzmichev
2010-11-30  2:04       ` Lei Wen
2010-11-30 15:13         ` Vitaly Kuzmichev
2010-11-30 15:55           ` Lei Wen
2010-11-30 16:41             ` Vitaly Kuzmichev
2010-12-01 15:32               ` Lei Wen
2010-12-01 15:43                 ` Lei Wen
2010-12-02 16:34                   ` Vitaly Kuzmichev
2010-12-03  2:35                     ` Lei Wen
2010-12-09 18:53                   ` Remy Bohmer

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=4CEFFB0A.3080804@mvista.com \
    --to=vkuzmichev@mvista.com \
    --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.