From 6f34c02e517689faa5b04809b448891228a44355 Mon Sep 17 00:00:00 2001 From: Nathan Hintz Date: Tue, 24 Sep 2013 11:21:02 -0700 Subject: [PATCH] vlan: set the name of vlan devices earlier Set the device name earlier so that the logging done inside of 'device_init_virtual' can print the name of the device being initialized (instead of an empty string). Signed-off-by: Nathan Hintz --- vlan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vlan.c b/vlan.c index 4589675..f70420a 100644 --- a/vlan.c +++ b/vlan.c @@ -115,15 +115,15 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create) vldev = calloc(1, sizeof(*vldev)); + vldev->id = id; + vlan_dev_set_name(vldev, dev); + device_init_virtual(&vldev->dev, &vlan_type, NULL); vldev->dev.default_config = true; vldev->set_state = vldev->dev.set_state; vldev->dev.set_state = vlan_set_device_state; - vldev->id = id; - vlan_dev_set_name(vldev, dev); - vldev->dep.cb = vlan_dev_cb; device_add_user(&vldev->dep, dev); -- 2.25.1