-struct device_meta*
-device_getbyid(struct llist_header* devlist, u32_t id)
-{
- devlist = devlist ? devlist : &root_list;
- struct device_meta *pos, *n;
- llist_for_each(pos, n, devlist, siblings)
- {
- if (pos->dev_uid == id) {
- return pos;
- }
- }
-
- return NULL;
-}
-
-struct device_meta*
-device_getbyhname(struct device_meta* root_dev, struct hstr* name)
-{
- struct llist_header* devlist = root_dev ? &root_dev->children : &root_list;
- struct device_meta *pos, *n;
- llist_for_each(pos, n, devlist, siblings)
- {
- if (HSTR_EQ(&pos->name, name)) {
- return pos;
- }
- }
-
- return NULL;
-}
-
-struct device_meta*
-device_getbyname(struct device_meta* root_dev, const char* name, size_t len)
-{
- struct hstr hname = HSTR(name, len);
- hstr_rehash(&hname, HSTR_FULL_HASH);
-
- return device_getbyhname(root_dev, &hname);
-}
-