X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fpci%2Fhotplug%2Frpadlpar_core.c;h=ed4b23c3c5e016df9bf596df3bdf89bcfa823758;hb=70790a4b5cd6c0291e5b1a2836e2832d46036ac6;hp=b321b47cf010b9040b8daccce7582c4d20aad804;hpb=413ba3004a4036bb5d6e52d2faa2b19cb13561dc;p=linux-2.6.git diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index b321b47cf..ed4b23c3c 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c @@ -18,31 +18,13 @@ #include #include #include +#include #include "../pci.h" #include "rpaphp.h" #include "rpadlpar.h" static DECLARE_MUTEX(rpadlpar_sem); -static inline int is_hotplug_capable(struct device_node *dn) -{ - unsigned char *ptr = get_property(dn, "ibm,fw-pci-hot-plug-ctrl", NULL); - - return (int) (ptr != NULL); -} - -static char *get_node_drc_name(struct device_node *dn) -{ - char *ptr = NULL; - int *drc_names; - - drc_names = (int *) get_property(dn, "ibm,drc-names", NULL); - if (drc_names) - ptr = (char *) &drc_names[1]; - - return ptr; -} - static struct device_node *find_php_slot_vio_node(char *drc_name) { struct device_node *child; @@ -53,9 +35,9 @@ static struct device_node *find_php_slot_vio_node(char *drc_name) return NULL; for (child = of_get_next_child(parent, NULL); - child; child = of_get_next_child(parent, child)) { + child; child = of_get_next_child(parent, child)) { loc_code = get_property(child, "ibm,loc-code", NULL); - if (loc_code && !strcmp(loc_code, drc_name)) + if (loc_code && !strncmp(loc_code, drc_name, strlen(drc_name))) return child; } @@ -69,7 +51,7 @@ static struct device_node *find_php_slot_pci_node(char *drc_name) while ((np = of_find_node_by_type(np, "pci"))) if (is_hotplug_capable(np)) { - name = get_node_drc_name(np); + name = rpaphp_get_drc_name(np); if (name && (!strcmp(drc_name, name))) break; } @@ -324,6 +306,7 @@ int dlpar_remove_pci_slot(struct slot *slot, char *drc_name) } /* Remove pci bus */ + if (dlpar_pci_remove_bus(bridge_dev)) { printk(KERN_ERR "%s: unable to remove pci bus %s\n", __FUNCTION__, drc_name); @@ -364,7 +347,7 @@ int dlpar_remove_slot(char *drc_name) rc = -EINVAL; goto exit; } - + switch (slot->dev_type) { case PCI_DEV: rc = dlpar_remove_pci_slot(slot, drc_name);