Deleted Added
full compact
26c26
< * $Id: subr_bus.c,v 1.26 1999/05/22 14:57:15 dfr Exp $
---
> * $Id: subr_bus.c,v 1.27 1999/05/27 07:18:41 dfr Exp $
606a607
> dev->order = 0;
637,649c638
< device_t child;
<
< PDEBUG(("%s at %s as unit %d with%s ivars",
< name, DEVICENAME(dev), unit, (ivars? "":"out")));
<
< child = make_device(dev, name, unit, ivars);
<
< if (child)
< TAILQ_INSERT_TAIL(&dev->children, child, link);
< else
< PDEBUG(("%s failed", name));
<
< return child;
---
> return device_add_child_ordered(dev, 0, name, unit, ivars);
653,654c642,643
< device_add_child_after(device_t dev, device_t place, const char *name,
< int unit, void *ivars)
---
> device_add_child_ordered(device_t dev, int order,
> const char *name, int unit, void *ivars)
656a646
> device_t place;
658,659c648,649
< PDEBUG(("%s at %s after %s as unit %d with%s ivars",
< name, DEVICENAME(dev), DEVICENAME(place), unit, (ivars? "":"out")));
---
> PDEBUG(("%s at %s with order %d as unit %d with%s ivars",
> name, DEVICENAME(dev), order, unit, (ivars? "":"out")));
663a654
> child->order = order;
664a656,659
> TAILQ_FOREACH(place, &dev->children, link)
> if (place->order > order)
> break;
>
666c661,665
< TAILQ_INSERT_AFTER(&dev->children, place, child, link);
---
> /*
> * The device 'place' is the first device whose order is
> * greater than the new child.
> */
> TAILQ_INSERT_BEFORE(place, child, link);
668c667,671
< TAILQ_INSERT_HEAD(&dev->children, child, link);
---
> /*
> * The new child's order is greater or equal to the order of
> * any existing device. Add the child to the tail of the list.
> */
> TAILQ_INSERT_TAIL(&dev->children, child, link);