for (fn = 0; fn < 8; fn++) { if (!(dev = pci_find_slot(p_slot->bus, PCI_DEVFN(p_slot->device, fn)))) continue; if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { err("Cannot hot-add display device %s\n", pci_name(dev)); continue; } if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) { /* Find an unused bus number for the new bridge */ struct pci_bus *child; unsigned char busnr, start = parent->secondary; unsigned char end = parent->subordinate; for (busnr = start; busnr <= end; busnr++) { if (!pci_find_bus(pci_domain_nr(parent), busnr)) break; } if (busnr >= end) { err("No free bus for hot-added bridge\n"); continue; } child = pci_add_new_bus(parent, dev, busnr); if (!child) { err("Cannot add new bus for %s\n", pci_name(dev)); continue; } child->subordinate = pci_do_scan_bus(child); pci_bus_size_bridges(child); } /* TBD: program firmware provided _HPP values */ /* program_fw_provided_values(dev); */ }  pci_bus_assign_resources(parent); pci_bus_add_devices(parent); pci_enable_bridges(parent); 
int shpchp_configure_device (struct controller* ctrl, struct pci_func* func)  {	unsigned char bus;	struct pci_bus *child;	int num;	if (func->pci_dev == NULL)		func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function));	/* Still NULL ? Well then scan for it ! */	if (func->pci_dev == NULL) {		num = pci_scan_slot(ctrl->pci_dev->subordinate, PCI_DEVFN(func->device, func->function));		if (num) {			dbg("%s: subordiante %p number %x\n", __FUNCTION__, ctrl->pci_dev->subordinate,				ctrl->pci_dev->subordinate->number);			pci_bus_add_devices(ctrl->pci_dev->subordinate);		}				func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function));		if (func->pci_dev == NULL) {			dbg("ERROR: pci_dev still null\n");			return 0;		}	}	if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {		pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus);		child = pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus);		pci_do_scan_bus(child);	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/dbd7a78818d125a0ebd5507d4edb4dd5900006ab/shpchp_pci.c/clean/drivers/pci/hotplug/shpchp_pci.c