func->status = 0; 
p_slot->status = 0; 
static u32 board_added(struct pci_func * func, struct controller * ctrl){	u8 hp_slot;	u32 temp_register = 0xFFFFFFFF;	u32 rc = 0;	struct slot *p_slot;	p_slot = pciehp_find_slot(ctrl, func->device);	hp_slot = func->device - ctrl->slot_device_offset;	dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n", __FUNCTION__, func->device, ctrl->slot_device_offset, hp_slot);	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	if (POWER_CTRL(ctrl->ctrlcap)) {		/* Power on slot */		rc = p_slot->hpc_ops->power_on_slot(p_slot);		if (rc) {			up(&ctrl->crit_sect);			return -1;		}		/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}		if (PWR_LED(ctrl->ctrlcap)) {		p_slot->hpc_ops->green_led_blink(p_slot);					/* Wait for the command to complete */		wait_for_ctrl_irq (ctrl);	}	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);	/* Wait for ~1 second */	dbg("%s: before long_delay\n", __FUNCTION__);	wait_for_ctrl_irq (ctrl);	dbg("%s: afterlong_delay\n", __FUNCTION__);	/*  Check link training status */	rc = p_slot->hpc_ops->check_lnk_status(ctrl);  	if (rc) {		err("%s: Failed to check link status\n", __FUNCTION__);		set_slot_off(ctrl, p_slot);		return rc;	}	dbg("%s: func status = %x\n", __FUNCTION__, func->status);	/* Check for a power fault */	if (func->status == 0xFF) {		/* power fault occurred, but it was benign */		temp_register = 0xFFFFFFFF;		dbg("%s: temp register set to %x by power fault\n", __FUNCTION__, temp_register);		rc = POWER_FAILURE;		func->status = 0;		goto err_exit;	}	rc = pciehp_configure_device(p_slot);	if (rc) {		err("Cannot add device 0x%x:%x\n", p_slot->bus,				p_slot->device);		goto err_exit;	}	pciehp_save_slot_config(ctrl, func);	func->status = 0;	func->switch_save = 0x10;	func->is_a_board = 0x01;	/*	 * Some PCI Express root ports require fixup after hot-plug operation.	 */	if (pcie_mch_quirk)		pci_fixup_device(pci_fixup_final, ctrl->pci_dev);	if (PWR_LED(ctrl->ctrlcap)) {		/* Wait for exclusive access to hardware */  		down(&ctrl->crit_sect);  		p_slot->hpc_ops->green_led_on(p_slot);    		/* Wait for the command to complete */  		wait_for_ctrl_irq (ctrl);  	  		/* Done with exclusive hardware access */  		up(&ctrl->crit_sect);  	}	return 0;err_exit:	set_slot_off(ctrl, p_slot);	return -1;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ca22a5e4d70620b7f3d809e424daa5214b0aa00d/pciehp_ctrl.c/buggy/drivers/pci/hotplug/pciehp_ctrl.c