X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=vlan.c;h=bf8cfba21b9d948387c8fc6e01cce8851f593c62;hp=85fe078eb118f11bf0f6007d2819bbc801105663;hb=7c4108d49d3048d8c14e73d5f366a13ed814df8d;hpb=170304603e7d905e98301c703ad2ec107b9a774c diff --git a/vlan.c b/vlan.c index 85fe078..bf8cfba 100644 --- a/vlan.c +++ b/vlan.c @@ -32,18 +32,18 @@ static int vlan_set_device_state(struct device *dev, bool up) if (!up) { vldev->set_state(dev, false); system_vlan_del(dev); - release_device(vldev->dep.dev); + device_release(&vldev->dep); return 0; } - ret = device_claim(vldev->dep.dev); + ret = device_claim(&vldev->dep); if (ret) return ret; system_vlan_add(vldev->dep.dev, vldev->id); ret = vldev->set_state(dev, true); if (ret) - release_device(vldev->dep.dev); + device_release(&vldev->dep); return ret; } @@ -69,6 +69,7 @@ static struct device *get_vlan_device(struct device *dev, int id, bool create) { static const struct device_type vlan_type = { .name = "VLAN", + .config_params = &device_attr_list, .free = free_vlan_if, }; struct vlan_device *vldev; @@ -120,7 +121,7 @@ out: struct device *get_vlan_device_chain(const char *ifname, bool create) { - struct device *iface = NULL; + struct device *dev = NULL; char *buf, *s, *next, *err = NULL; int id; @@ -129,8 +130,8 @@ struct device *get_vlan_device_chain(const char *ifname, bool create) return NULL; s = split_vlan(buf); - iface = device_get(buf, create); - if (!iface && !create) + dev = device_get(buf, create); + if (!dev && !create) goto error; do { @@ -139,8 +140,8 @@ struct device *get_vlan_device_chain(const char *ifname, bool create) if (err && *err) goto error; - iface = get_vlan_device(iface, id, create); - if (!iface) + dev = get_vlan_device(dev, id, create); + if (!dev) goto error; s = next; @@ -149,8 +150,8 @@ struct device *get_vlan_device_chain(const char *ifname, bool create) } while (1); error: - iface = NULL; + dev = NULL; out: free(buf); - return iface; + return dev; }