From: Felix Fietkau Date: Thu, 5 Jul 2012 13:06:09 +0000 (+0200) Subject: device: initialize dev->set_state for virtual devices X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=625a5a26ec6da9e8e7c969b383a5cac7701ed6f6;p=oweals%2Fnetifd.git device: initialize dev->set_state for virtual devices --- diff --git a/device.c b/device.c index 82c83d1..017fe03 100644 --- a/device.c +++ b/device.c @@ -346,6 +346,9 @@ void device_init_virtual(struct device *dev, const struct device_type *type, con D(DEVICE, "Initialize device '%s'\n", dev->ifname); INIT_LIST_HEAD(&dev->users); dev->type = type; + + if (!dev->set_state) + dev->set_state = set_device_state; } int device_init(struct device *dev, const struct device_type *type, const char *ifname) @@ -354,9 +357,6 @@ int device_init(struct device *dev, const struct device_type *type, const char * device_init_virtual(dev, type, ifname); - if (!dev->set_state) - dev->set_state = set_device_state; - dev->avl.key = dev->ifname; ret = avl_insert(&devices, &dev->avl);