It refers to the previous value in linked-list, not to the next.
if (!bus && ! (bus = find_bus(b, p->domain, p->bus)))
{
struct bridge *c;
- for (c=b->child; c; c=c->next)
+ for (c=b->child; c; c=c->prev)
if (c->domain == (unsigned)p->domain && c->secondary <= p->bus && p->bus <= c->subordinate)
{
insert_dev(d, c);
}
*last_br = b;
last_br = &b->chain;
- b->next = b->child = NULL;
+ b->prev = b->child = NULL;
b->first_bus = NULL;
b->last_bus = NULL;
b->br_dev = d;
b->subordinate = b->secondary;
*last_br = b;
last_br = &b->chain;
- b->next = b->child = NULL;
+ b->prev = b->child = NULL;
b->first_bus = NULL;
b->last_bus = NULL;
b->br_dev = parent;
best = c;
if (best)
{
- b->next = best->child;
+ b->prev = best->child;
best->child = b;
}
}
struct bridge {
struct bridge *chain; /* Single-linked list of bridges */
- struct bridge *next, *child; /* Tree of bridges */
+ struct bridge *prev, *child; /* Tree of bridges */
struct bus *first_bus, *last_bus; /* List of buses connected to this bridge */
unsigned int domain;
unsigned int primary, secondary, subordinate; /* Bus numbers */