From 625a5a26ec6da9e8e7c969b383a5cac7701ed6f6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 5 Jul 2012 15:06:09 +0200 Subject: [PATCH] device: initialize dev->set_state for virtual devices --- device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.25.1