dbg("%s: ctrl->pci_bus %p\n", __FUNCTION__, ctrl->pci_bus); 
static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_id *id){	int rc;	struct controller *ctrl;	struct slot *t_slot;	int first_device_num = 0 ;	/* first PCI device number supported by this PCIE */  	int num_ctlr_slots;		/* number of slots supported by this HPC */	u8 value;	struct pci_dev *pdev;		dbg("%s: Called by hp_drv\n", __FUNCTION__);	ctrl = kmalloc(sizeof(*ctrl), GFP_KERNEL);	if (!ctrl) {		err("%s : out of memory\n", __FUNCTION__);		goto err_out_none;	}	memset(ctrl, 0, sizeof(struct controller));	dbg("%s: DRV_thread pid = %d\n", __FUNCTION__, current->pid);		pdev = dev->port;	ctrl->pci_dev = pdev;	rc = pcie_init(ctrl, dev);	if (rc) {		dbg("%s: controller initialization failed\n", PCIE_MODULE_NAME);		goto err_out_free_ctrl;	}	pci_set_drvdata(pdev, ctrl);	ctrl->pci_bus = kmalloc(sizeof(*ctrl->pci_bus), GFP_KERNEL);	if (!ctrl->pci_bus) {		err("%s: out of memory\n", __FUNCTION__);		rc = -ENOMEM;		goto err_out_unmap_mmio_region;	}	dbg("%s: ctrl->pci_bus %p\n", __FUNCTION__, ctrl->pci_bus);	memcpy (ctrl->pci_bus, pdev->bus, sizeof (*ctrl->pci_bus));	ctrl->bus = pdev->bus->number;  /* ctrl bus */	ctrl->slot_bus = pdev->subordinate->number;  /* bus controlled by this HPC */	ctrl->device = PCI_SLOT(pdev->devfn);	ctrl->function = PCI_FUNC(pdev->devfn);	dbg("%s: ctrl bus=0x%x, device=%x, function=%x, irq=%x\n", __FUNCTION__,		ctrl->bus, ctrl->device, ctrl->function, pdev->irq);	/*	 *	Save configuration headers for this and subordinate PCI buses	 */	rc = get_ctlr_slot_config(ctrl);	if (rc) {		err(msg_initialization_err, rc);		goto err_out_free_ctrl_bus;	}	first_device_num = ctrl->slot_device_offset;	num_ctlr_slots = ctrl->num_slots; 	/* Setup the slot information structures */	rc = init_slots(ctrl);	if (rc) {		err(msg_initialization_err, 6);		goto err_out_free_ctrl_slot;	}	t_slot = pciehp_find_slot(ctrl, first_device_num);	dbg("%s: t_slot %p\n", __FUNCTION__, t_slot);	/*	Finish setting up the hot plug ctrl device */	ctrl->next_event = 0;	if (!pciehp_ctrl_list) {		pciehp_ctrl_list = ctrl;		ctrl->next = NULL;	} else {		ctrl->next = pciehp_ctrl_list;		pciehp_ctrl_list = ctrl;	}	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	t_slot->hpc_ops->get_adapter_status(t_slot, &value); /* Check if slot is occupied */	dbg("%s: adpater value %x\n", __FUNCTION__, value);		if ((POWER_CTRL(ctrl->ctrlcap)) && !value) {		rc = t_slot->hpc_ops->power_off_slot(t_slot); /* Power off slot if not occupied*/		if (rc) {			/* Done with exclusive hardware access */			up(&ctrl->crit_sect);			goto err_out_free_ctrl_slot;		} else			/* Wait for the command to complete */			wait_for_ctrl_irq (ctrl);	}	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);	return 0;err_out_free_ctrl_slot:	cleanup_slots(ctrl);err_out_free_ctrl_bus:	kfree(ctrl->pci_bus);err_out_unmap_mmio_region:	ctrl->hpc_ops->release_ctlr(ctrl);err_out_free_ctrl:	kfree(ctrl);err_out_none:	return -ENODEV;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1a9ed1bfe2fb17cc30227a12a3c1212128bb78b6/pciehp_core.c/clean/drivers/pci/hotplug/pciehp_core.c