struct resource_lists res_lists; struct pci_func *temp_func; 
static u32 remove_board(struct pci_func *func, struct controller *ctrl){	int index;	u8 skip = 0;	u8 device;	u8 hp_slot;	u32 rc;	struct resource_lists res_lists;	struct pci_func *temp_func;	struct slot *p_slot;	if (func == NULL)		return(1);	if (shpchp_unconfigure_device(func))		return(1);	device = func->device;	hp_slot = func->device - ctrl->slot_device_offset;	p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);	dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot);	if ((ctrl->add_support) &&		!(func->bus_head || func->mem_head || func->p_mem_head || func->io_head)) {		/* Here we check to see if we've saved any of the board's		 * resources already.  If so, we'll skip the attempt to		 * determine what's being used.		 */		index = 0;		temp_func = func;		while ((temp_func = shpchp_slot_find(temp_func->bus, temp_func->device, index++))) {			if (temp_func->bus_head || temp_func->mem_head			    || temp_func->p_mem_head || temp_func->io_head) {				skip = 1;				break;			}		}		if (!skip)			rc = shpchp_save_used_resources(ctrl, func, DISABLE_CARD);	}	/* Change status to shutdown */	if (func->is_a_board)		func->status = 0x01;	func->configured = 0;	/* Wait for exclusive access to hardware */	down(&ctrl->crit_sect);	/* turn off slot, turn on Amber LED, turn off Green LED */	rc = p_slot->hpc_ops->slot_disable(p_slot);	if (rc) {		err("%s: Issue of Slot Disable command failed\n", __FUNCTION__);		/* Done with exclusive hardware access */		up(&ctrl->crit_sect);		return rc;	}	/* Wait for the command to complete */	wait_for_ctrl_irq (ctrl);	rc = p_slot->hpc_ops->check_cmd_status(ctrl);	if (rc) {		err("%s: Failed to disable slot, error code(%d)\n", __FUNCTION__, rc);		/* Done with exclusive hardware access */		up(&ctrl->crit_sect);		return rc;  	}		rc = p_slot->hpc_ops->set_attention_status(p_slot, 0);	if (rc) {		err("%s: Issue of Set Attention command failed\n", __FUNCTION__);		/* Done with exclusive hardware access */		up(&ctrl->crit_sect);		return rc;	}	/* Wait for the command to complete */	wait_for_ctrl_irq (ctrl);	/* Done with exclusive hardware access */	up(&ctrl->crit_sect);	if (ctrl->add_support) {		while (func) {			res_lists.io_head = ctrl->io_head;			res_lists.mem_head = ctrl->mem_head;			res_lists.p_mem_head = ctrl->p_mem_head;			res_lists.bus_head = ctrl->bus_head;			dbg("Returning resources to ctlr lists for (B/D/F) = (%#x/%#x/%#x)\n", func->bus, 				func->device, func->function);			shpchp_return_board_resources(func, &res_lists);			ctrl->io_head = res_lists.io_head;			ctrl->mem_head = res_lists.mem_head;			ctrl->p_mem_head = res_lists.p_mem_head;			ctrl->bus_head = res_lists.bus_head;			shpchp_resource_sort_and_combine(&(ctrl->mem_head));			shpchp_resource_sort_and_combine(&(ctrl->p_mem_head));			shpchp_resource_sort_and_combine(&(ctrl->io_head));			shpchp_resource_sort_and_combine(&(ctrl->bus_head));			if (is_bridge(func)) {				dbg("PCI Bridge Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, 					func->device, func->function);				bridge_slot_remove(func);			} else				dbg("PCI Function Hot-Remove s:b:d:f(%02x:%02x:%02x:%02x)\n", ctrl->seg, func->bus, 					func->device, func->function);				slot_remove(func);			func = shpchp_slot_find(ctrl->slot_bus, device, 0);		}		/* Setup slot structure with entry for empty slot */		func = shpchp_slot_create(ctrl->slot_bus);		if (func == NULL) {			return(1);		}		func->bus = ctrl->slot_bus;		func->device = device;		func->function = 0;		func->configured = 0;		func->switch_save = 0x10;		func->pwr_save = 0;		func->is_a_board = 0;	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/dbd7a78818d125a0ebd5507d4edb4dd5900006ab/shpchp_ctrl.c/clean/drivers/pci/hotplug/shpchp_ctrl.c