/* Returns 0 if successful, anything else for an error.  */
int pci_hp_deregister(struct hotplug_slot *hotplug)
/* Returns 0 if successful, anything else for an error.  */
int pci_hp_deregister(struct hotplug_slot *hotplug)
{
	struct hotplug_slot *temp;
	struct pci_slot *slot;
	if (!hotplug)
		return -ENODEV;
	mutex_lock(&pci_hp_mutex);
	temp = get_slot_from_name(hotplug_slot_name(hotplug));
	if (temp != hotplug) {
		mutex_unlock(&pci_hp_mutex);
		return -ENODEV;
	}
	list_del(&hotplug->slot_list);
	slot = hotplug->pci_slot;
	fs_remove_slot(slot);
	dbg("Removed slot %s from the list\n", hotplug_slot_name(hotplug));
	hotplug->release(hotplug);
	slot->hotplug = NULL;
	pci_destroy_slot(slot);
	mutex_unlock(&pci_hp_mutex);
	return 0;
}