struct udevice *dev;
*devp = NULL;
- if (seq_or_req_seq == -1)
- return -ENODEV;
list_for_each_entry(dev, &parent->child_head, sibling_node) {
- if ((find_req_seq ? dev->req_seq : dev_seq(dev)) ==
- seq_or_req_seq) {
+ if (dev->sqq == seq_or_req_seq) {
*devp = dev;
return 0;
}
ut_asserteq(-ENODEV, device_find_child_by_seq(bus, -1, true, &dev));
ut_assertok(device_find_child_by_seq(bus, 0, true, &dev));
ut_assert(!(dev->flags & DM_FLAG_ACTIVATED));
- ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 0, false, &dev));
+ ut_asserteq(0, device_find_child_by_seq(bus, 0, false, &dev));
ut_assertok(device_get_child_by_seq(bus, 0, &dev));
ut_assert(dev->flags & DM_FLAG_ACTIVATED);
+ ut_asserteq(0, device_find_child_by_seq(bus, 0, false, &dev));
/* There is no device with sequence number 2 */
ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, false, &dev));