summaryrefslogtreecommitdiffhomepage
path: root/macvlan.c
diff options
context:
space:
mode:
authorArne Kappen <akappen@inet.tu-berlin.de>2016-08-18 11:35:28 +0200
committerFelix Fietkau <nbd@nbd.name>2016-08-26 10:38:46 +0200
commitf56a7fbaa6f155c654e7d01b5c4c0594f21239d6 (patch)
tree08e2b400aa2d70cf9655274c5f7885623acdcf40 /macvlan.c
parent61e5fa84eca4176bc5b4f9769a5af79d85cf11c6 (diff)
device: prepare for adding device handlers dynamically
- remove const from device handler struct - pass device handler type to create function Signed-off-by: Arne Kappen <akappen@inet.tu-berlin.de> Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup]
Diffstat (limited to 'macvlan.c')
-rw-r--r--macvlan.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/macvlan.c b/macvlan.c
index a0f11ae..ffadfd4 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,7 +253,7 @@ macvlan_create(const char *name, struct blob_attr *attr)
return dev;
}
-const struct device_type macvlan_device_type = {
+struct device_type macvlan_device_type = {
.name = "MAC VLAN",
.config_params = &macvlan_attr_list,
.create = macvlan_create,