{
struct device *dev;
- dev = get_device(name, true);
+ dev = device_get(name, true);
if (!dev)
return;
struct bridge_state *bst;
struct device *dev;
- dev = get_device(name, false);
+ dev = device_get(name, false);
if (dev)
return NULL;
if (!strcmp(blobmsg_data(cur), "bridge"))
dev = bridge_create(name, s);
} else {
- dev = get_device(name, true);
+ dev = device_get(name, true);
}
if (!dev)
return 0;
}
-struct device *get_device(const char *name, bool create)
+struct device *device_get(const char *name, bool create)
{
static const struct device_type simple_type = {
.name = "Device",
void init_virtual_device(struct device *dev, const struct device_type *type, const char *name);
int init_device(struct device *iface, const struct device_type *type, const char *ifname);
void device_cleanup(struct device *iface);
-struct device *get_device(const char *name, bool create);
+struct device *device_get(const char *name, bool create);
void device_add_user(struct device_user *dep, struct device *iface);
void device_remove_user(struct device_user *dep);
}
if ((cur = tb[IFACE_ATTR_IFNAME])) {
- dev = get_device(blobmsg_data(cur), true);
+ dev = device_get(blobmsg_data(cur), true);
if (dev)
device_add_user(&iface->main_dev, dev);
}
if (!tb[DEV_NAME])
return UBUS_STATUS_INVALID_ARGUMENT;
- dev = get_device(blobmsg_data(tb[DEV_NAME]), false);
+ dev = device_get(blobmsg_data(tb[DEV_NAME]), false);
if (!dev)
return UBUS_STATUS_NOT_FOUND;
return NULL;
s = split_vlan(buf);
- iface = get_device(buf, create);
+ iface = device_get(buf, create);
if (!iface && !create)
goto error;