set the type before doing the vmap so calls to cnam() will be set, avoiding a double-falure case when vmap fails and then we indirect nil to get the controler name. Reference: /n/atom/patch/applied2013/ahcityporder Date: Tue Sep 17 01:11:49 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/nix/k10/sdahci.c Tue Sep 17 01:10:55 2013 +++ /sys/src/nix/k10/sdahci.c Tue Sep 17 01:10:55 2013 @@ -1839,6 +1839,7 @@ s = sdevs + niactlr; memset(c, 0, sizeof *c); memset(s, 0, sizeof *s); + c->type = cttab + type; io = p->mem[Abar].bar & ~0xf; c->mmio = vmap(io, p->mem[Abar].size); if(c->mmio == nil){ @@ -1848,7 +1849,6 @@ } c->lmmio = (u32int*)c->mmio; c->pci = p; - c->type = cttab + type; s->ifc = &sdahciifc; s->idno = 'E';