aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 7830a4aee94..16922ff15c6 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1860,10 +1860,18 @@ static int rndis_control_ack(struct eth_device *net)
static int rndis_control_ack(struct udevice *net)
#endif
{
- struct ether_priv *priv = (struct ether_priv *)net->priv;
- struct eth_dev *dev = &priv->ethdev;
- int length;
- struct usb_request *resp = dev->stat_req;
+ struct ether_priv *priv;
+ struct eth_dev *dev;
+ int length;
+ struct usb_request *resp;
+
+#ifndef CONFIG_DM_ETH
+ priv = (struct ether_priv *)net->priv;
+#else
+ priv = dev_get_priv(net);
+#endif
+ dev = &priv->ethdev;
+ resp = dev->stat_req;
/* in case RNDIS calls this after disconnect */
if (!dev->status) {