From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>, Kevin Hilman <khilman@baylibre.com>,
Lukasz Majewski <lukma@denx.de>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Simon Glass <sjg@chromium.org>
Subject: [PATCH v3 3/4] usb: gadget: ether: Move probe function above driver structure
Date: Sat, 29 Jul 2023 16:57:11 +0200 [thread overview]
Message-ID: <20230729145712.213945-3-marex@denx.de> (raw)
In-Reply-To: <20230729145712.213945-1-marex@denx.de>
Move the driver probe function above the driver structure, so it
can be placed alongside other related functions, like upcoming
remove function. No functional change.
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Simon Glass <sjg@chromium.org>
---
V2: No change
V3: No change
---
drivers/usb/gadget/ether.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 88c656c4dc0..2040b5b5081 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2486,20 +2486,6 @@ static int usb_eth_free_pkt(struct udevice *dev, uchar *packet,
return rx_submit(ethdev, ethdev->rx_req, 0);
}
-static int usb_eth_probe(struct udevice *dev)
-{
- struct ether_priv *priv = dev_get_priv(dev);
- struct eth_pdata *pdata = dev_get_plat(dev);
-
- priv->netdev = dev;
- l_priv = priv;
-
- get_ether_addr(CONFIG_USBNET_DEV_ADDR, pdata->enetaddr);
- eth_env_set_enetaddr("usbnet_devaddr", pdata->enetaddr);
-
- return 0;
-}
-
static const struct eth_ops usb_eth_ops = {
.start = usb_eth_start,
.send = usb_eth_send,
@@ -2528,6 +2514,20 @@ int usb_ether_init(void)
return 0;
}
+static int usb_eth_probe(struct udevice *dev)
+{
+ struct ether_priv *priv = dev_get_priv(dev);
+ struct eth_pdata *pdata = dev_get_plat(dev);
+
+ priv->netdev = dev;
+ l_priv = priv;
+
+ get_ether_addr(CONFIG_USBNET_DEV_ADDR, pdata->enetaddr);
+ eth_env_set_enetaddr("usbnet_devaddr", pdata->enetaddr);
+
+ return 0;
+}
+
U_BOOT_DRIVER(eth_usb) = {
.name = "usb_ether",
.id = UCLASS_ETH,
--
2.40.1
next prev parent reply other threads:[~2023-07-29 14:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-29 14:57 [PATCH v3 1/4] cmd: bind: Add unbind command with driver filter Marek Vasut
2023-07-29 14:57 ` [PATCH v3 2/4] usb: gadget: ether: Inline functions used once Marek Vasut
2023-07-29 14:57 ` Marek Vasut [this message]
2023-07-29 14:57 ` [PATCH v3 4/4] usb: gadget: ether: Handle gadget driver registration in probe and remove Marek Vasut
2023-07-31 9:31 ` [PATCH v3 1/4] cmd: bind: Add unbind command with driver filter Miquel Raynal
2023-07-31 11:44 ` Marek Vasut
2023-07-31 13:36 ` Miquel Raynal
2023-07-31 13:50 ` Marek Vasut
2023-07-31 13:58 ` Miquel Raynal
2023-07-31 14:08 ` Marek Vasut
2023-07-31 14:25 ` Miquel Raynal
2023-07-31 14:40 ` Marek Vasut
2023-08-01 18:53 ` Miquel Raynal
2023-08-01 23:07 ` Marek Vasut
2023-08-02 7:48 ` Miquel Raynal
2023-08-02 14:38 ` Marek Vasut
2023-08-02 14:42 ` Miquel Raynal
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=20230729145712.213945-3-marex@denx.de \
--to=marex@denx.de \
--cc=khilman@baylibre.com \
--cc=lukma@denx.de \
--cc=miquel.raynal@bootlin.com \
--cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox