Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 934199e9 authored by Linas Vepstas's avatar Linas Vepstas Committed by Greg Kroah-Hartman
Browse files

[PATCH] ppc64 PCI Hotplug: cleanup unsymmetric API routines



This is a minor patch to the ppc64 PCI hotplug code; it makes the call to
rpaphp_unconfig_pci_adapter() symmetric with respect to the call to
rpaphp_config_pci_adapter().  I discussed this with John Rose, who
had provided the last round of changes for these functions; he
appearently had this patch but somehow failed to mail it out.

Tested. (added/removed device).

Signed-off-by: default avatarLinas Vepstas <linas@austin.ibm.com>

 drivers/pci/hotplug/rpaphp.h      |    3 ++-
 drivers/pci/hotplug/rpaphp_core.c |    5 ++++-
 drivers/pci/hotplug/rpaphp_pci.c  |   11 +++--------
 3 files changed, 9 insertions(+), 10 deletions(-)
parent b7924c38
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -92,9 +92,10 @@ extern struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn);
extern int rpaphp_claim_resource(struct pci_dev *dev, int resource);
extern int rpaphp_claim_resource(struct pci_dev *dev, int resource);
extern int rpaphp_enable_pci_slot(struct slot *slot);
extern int rpaphp_enable_pci_slot(struct slot *slot);
extern int register_pci_slot(struct slot *slot);
extern int register_pci_slot(struct slot *slot);
extern int rpaphp_unconfig_pci_adapter(struct slot *slot);
extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);
extern int rpaphp_get_pci_adapter_status(struct slot *slot, int is_init, u8 * value);

extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
extern int rpaphp_config_pci_adapter(struct pci_bus *bus);
extern int rpaphp_unconfig_pci_adapter(struct pci_bus *bus);


/* rpaphp_core.c */
/* rpaphp_core.c */
extern int rpaphp_add_slot(struct device_node *dn);
extern int rpaphp_add_slot(struct device_node *dn);
+4 −1
Original line number Original line Diff line number Diff line
@@ -426,8 +426,11 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)


	dbg("DISABLING SLOT %s\n", slot->name);
	dbg("DISABLING SLOT %s\n", slot->name);
	down(&rpaphp_sem);
	down(&rpaphp_sem);
	retval = rpaphp_unconfig_pci_adapter(slot);
	retval = rpaphp_unconfig_pci_adapter(slot->bus);
	up(&rpaphp_sem);
	up(&rpaphp_sem);
	slot->state = NOT_CONFIGURED;
	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
	     slot->name);
exit:
exit:
	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
	dbg("%s - Exit: rc[%d]\n", __FUNCTION__, retval);
	return retval;
	return retval;
+3 −8
Original line number Original line Diff line number Diff line
@@ -319,20 +319,15 @@ static void rpaphp_eeh_remove_bus_device(struct pci_dev *dev)
	return;
	return;
}
}


int rpaphp_unconfig_pci_adapter(struct slot *slot)
int rpaphp_unconfig_pci_adapter(struct pci_bus *bus)
{
{
	struct pci_dev *dev, *tmp;
	struct pci_dev *dev, *tmp;
	int retval = 0;


	list_for_each_entry_safe(dev, tmp, slot->pci_devs, bus_list) {
	list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) {
		rpaphp_eeh_remove_bus_device(dev);
		rpaphp_eeh_remove_bus_device(dev);
		pci_remove_bus_device(dev);
		pci_remove_bus_device(dev);
	}
	}

	return 0;
	slot->state = NOT_CONFIGURED;
	info("%s: devices in slot[%s] unconfigured.\n", __FUNCTION__,
	     slot->name);
	return retval;
}
}


static int setup_pci_hotplug_slot_info(struct slot *slot)
static int setup_pci_hotplug_slot_info(struct slot *slot)