68 lines
1.9 KiB
Diff
68 lines
1.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Marek Vasut <marex@denx.de>
|
|
Date: Fri, 4 Aug 2023 17:41:10 +0200
|
|
Subject: usb: gadget: ether: Move probe function above driver structure
|
|
|
|
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>
|
|
Tested-by: Tom Rini <trini@konsulko.com>
|
|
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
|
Tested-by: Miquel Raynal <miquel.raynal@bootlin.com>
|
|
Reviewed-by: Tom Rini <trini@konsulko.com>
|
|
---
|
|
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 111111111111..222222222222 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,
|
|
--
|
|
Armbian
|
|
|