assert(dev);
- list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node) {
+ device_foreach_child_safe(pos, n, dev) {
if (drv && (pos->driver != drv))
continue;
assert(dev);
- list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node) {
+ device_foreach_child_safe(pos, n, dev) {
int ret;
if (drv && (pos->driver != drv))
assert(dev);
assert(new_parent);
- list_for_each_entry_safe(pos, n, &dev->parent->child_head,
- sibling_node) {
+ device_foreach_child_safe(pos, n, dev->parent) {
if (pos->driver != dev->driver)
continue;
{
struct udevice *dev;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (!index--)
return device_get_device_tail(dev, 0, devp);
}
struct udevice *dev;
int count = 0;
- list_for_each_entry(dev, &parent->child_head, sibling_node)
+ device_foreach_child(dev, parent)
count++;
return count;
const struct udevice *dev;
int count = 1;
- list_for_each_entry(dev, &parent->child_head, sibling_node)
+ device_foreach_child(dev, parent)
count += device_get_decendent_count(dev);
return count;
*devp = NULL;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (dev->seq_ == seq) {
*devp = dev;
return 0;
*devp = NULL;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (dev_of_offset(dev) == of_offset) {
*devp = dev;
return 0;
if (ofnode_equal(dev_ofnode(parent), ofnode))
return parent;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
found = _device_find_global_by_ofnode(dev, ofnode);
if (found)
return found;
struct udevice *dev;
*devp = NULL;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (!device_active(dev) &&
device_get_uclass_id(dev) == uclass_id) {
*devp = dev;
struct udevice *dev;
*devp = NULL;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (device_get_uclass_id(dev) == uclass_id) {
*devp = dev;
return 0;
*devp = NULL;
- list_for_each_entry(dev, &parent->child_head, sibling_node) {
+ device_foreach_child(dev, parent) {
if (!strncmp(dev->name, name, len) &&
strlen(dev->name) == len) {
*devp = dev;