USB: gadget: Add DEVTYPE support for Ethernet functions
[firefly-linux-kernel-4.4.55.git] / drivers / usb / gadget / u_ether.c
index 2fc02bd9584882b3cf523864f33dc0f412af1471..84ca195c2d10f8a2b71346bdd031ba18a15e1571 100644 (file)
@@ -746,6 +746,10 @@ static const struct net_device_ops eth_netdev_ops = {
        .ndo_validate_addr      = eth_validate_addr,
 };
 
+static struct device_type gadget_type = {
+       .name   = "gadget",
+};
+
 /**
  * gether_setup - initialize one ethernet-over-usb link
  * @g: gadget to associated with these links
@@ -808,6 +812,7 @@ int __init gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 
        dev->gadget = g;
        SET_NETDEV_DEV(net, &g->dev);
+       SET_NETDEV_DEVTYPE(net, &gadget_type);
 
        status = register_netdev(net);
        if (status < 0) {