patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / alpha / kernel / sys_takara.c
index 24c255e..126c433 100644 (file)
@@ -231,8 +231,12 @@ takara_swizzle(struct pci_dev *dev, u8 *pinp)
        int slot = PCI_SLOT(dev->devfn);
        int pin = *pinp;
        unsigned int ctlreg = inl(0x500);
-       unsigned int busslot = PCI_SLOT(dev->bus->self->devfn);
+       unsigned int busslot;
 
+       if (!dev->bus->self)
+               return slot;
+
+       busslot = PCI_SLOT(dev->bus->self->devfn);
        /* Check for built-in bridges.  */
        if (dev->bus->number != 0
            && busslot > 16