diff options
author | Nathan Hintz <nlhintz@hotmail.com> | 2013-09-24 11:21:02 -0700 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-09-25 08:24:15 +0200 |
commit | 6f34c02e517689faa5b04809b448891228a44355 (patch) | |
tree | e8c48599be346764770ba13cd5f37c52d32226df /vlan.c | |
parent | 814e09499e12edaea658f9f5594fe9917c0ecde4 (diff) |
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 <nlhintz@hotmail.com>
Diffstat (limited to 'vlan.c')
-rw-r--r-- | vlan.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |