Rewrite interrupt handling in coreboot to be more comprehensible and
[coreboot.git] / src / devices / pci_ops.c
index ed07564f611349d504930b89f7193fc0728b4c75..6029d757effabef8a96efa90c7a91c3071455161 100644 (file)
 
 static struct bus *get_pbus(device_t dev)
 {
-       struct bus *pbus;
+       struct bus *pbus = NULL;
 
        if (!dev)
                die("get_pbus: dev is NULL!\n");
-
-       pbus = dev->bus;
+       else
+               pbus = dev->bus;
 
        while(pbus && pbus->dev && !ops_pci_bus(pbus)) {
                if (pbus == pbus->dev->bus) {
                        printk_alert("%s in endless loop looking for a parent "
-                               "bus with ops_pci_bus for %s, breaking out\n",
+                               "bus with ops_pci_bus for %s, breaking out.\n",
                                 __func__, dev_path(dev));
                        break;
                }
                pbus = pbus->dev->bus;
        }
        if (!pbus || !pbus->dev || !pbus->dev->ops || !pbus->dev->ops->ops_pci_bus) {
-               printk_emerg("%s Cannot find pci bus operations\n", dev_path(dev));
+               printk_emerg("%s: Cannot find pci bus operations.\n", dev_path(dev));
                die("");
        }
        return pbus;