num_funcs = pci_scan_slot(slot->pci_bus, PCI_DEVFN(slot->device_num+1, PCI_FUNC(0))); 
num_funcs = pci_scan_slot(slot->pci_bus, PCI_DEVFN(slot->device_num + 1, 0)); 
static int enable_slot(struct hotplug_slot *bss_hotplug_slot){	struct slot *slot = (struct slot *)bss_hotplug_slot->private;	struct pci_bus *new_bus = NULL;	struct pci_dev *dev;	int func, num_funcs;	int new_ppb = 0;	int rc;	/* Serialize the Linux PCI infrastructure */	down(&sn_hotplug_sem);	/*	 * Power-on and initialize the slot in the SN	 * PCI infrastructure.	 */	rc = sn_slot_enable(bss_hotplug_slot, slot->device_num);	if (rc) {		up(&sn_hotplug_sem);		return rc;	}	num_funcs = pci_scan_slot(slot->pci_bus, PCI_DEVFN(slot->device_num+1,							   PCI_FUNC(0)));	if (!num_funcs) {		dev_dbg(slot->pci_bus->self, "no device in slot\n");		up(&sn_hotplug_sem);		return -ENODEV;	}	sn_pci_controller_fixup(pci_domain_nr(slot->pci_bus),				slot->pci_bus->number,				slot->pci_bus);	/*	 * Map SN resources for all functions on the card	 * to the Linux PCI interface and tell the drivers	 * about them.	 */	for (func = 0; func < num_funcs;  func++) {		dev = pci_get_slot(slot->pci_bus,				   PCI_DEVFN(slot->device_num + 1,					     PCI_FUNC(func)));		if (dev) {			if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) {				unsigned char sec_bus;				pci_read_config_byte(dev, PCI_SECONDARY_BUS,						     &sec_bus);				new_bus = pci_add_new_bus(dev->bus, dev,							  sec_bus);				pci_scan_child_bus(new_bus);				sn_pci_controller_fixup(pci_domain_nr(new_bus),							new_bus->number,							new_bus);				new_ppb = 1;			}			sn_bus_alloc_data(dev);			pci_dev_put(dev);		}	}	/* Call the driver for the new device */	pci_bus_add_devices(slot->pci_bus);	/* Call the drivers for the new devices subordinate to PPB */	if (new_ppb)		pci_bus_add_devices(new_bus);	up(&sn_hotplug_sem);	if (rc == 0)		dev_dbg(slot->pci_bus->self,			"insert operation successful\n");	else		dev_dbg(slot->pci_bus->self,			"insert operation failed rc = %d\n", rc);	return rc;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1d2450a4a6eb656798c6282b5ffc8e5f9f52ac14/sgi_hotplug.c/buggy/drivers/pci/hotplug/sgi_hotplug.c