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)
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);