X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=macvlan.c;h=021d3944fb1ccbee81d9f141539a39d1a47ab258;hp=a0f11ae1da1c52781c3dd630c15e5f1bfcc97619;hb=5fbd904e5b4ed87243c09c86adcfb17ae93aa4f5;hpb=4902ba2999dec02e82066d70ab6096b852a33007 diff --git a/macvlan.c b/macvlan.c index a0f11ae..021d394 100644 --- a/macvlan.c +++ b/macvlan.c @@ -228,7 +228,8 @@ macvlan_reload(struct device *dev, struct blob_attr *attr) } static struct device * -macvlan_create(const char *name, struct blob_attr *attr) +macvlan_create(const char *name, struct device_type *devtype, + struct blob_attr *attr) { struct macvlan_device *mvdev; struct device *dev = NULL; @@ -238,7 +239,7 @@ macvlan_create(const char *name, struct blob_attr *attr) return NULL; dev = &mvdev->dev; - device_init(dev, &macvlan_device_type, name); + device_init(dev, devtype, name); dev->config_pending = true; mvdev->set_state = dev->set_state; @@ -252,8 +253,8 @@ macvlan_create(const char *name, struct blob_attr *attr) return dev; } -const struct device_type macvlan_device_type = { - .name = "MAC VLAN", +static struct device_type macvlan_device_type = { + .name = "macvlan", .config_params = &macvlan_attr_list, .create = macvlan_create, .config_init = macvlan_config_init, @@ -261,3 +262,8 @@ const struct device_type macvlan_device_type = { .free = macvlan_free, .dump_info = macvlan_dump_info, }; + +static void __init macvlan_device_type_init(void) +{ + device_type_add(&macvlan_device_type); +}