diff options
Diffstat (limited to 'drivers/pci/hotplug')
| -rw-r--r-- | drivers/pci/hotplug/pciehprm_acpi.c | 8 | ||||
| -rw-r--r-- | drivers/pci/hotplug/rpadlpar_core.c | 20 | ||||
| -rw-r--r-- | drivers/pci/hotplug/rpaphp_pci.c | 8 |
3 files changed, 21 insertions, 15 deletions
diff --git a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c index 305b47ec2f2c..1406db35b089 100644 --- a/drivers/pci/hotplug/pciehprm_acpi.c +++ b/drivers/pci/hotplug/pciehprm_acpi.c | |||
| @@ -1696,15 +1696,15 @@ void pciehprm_enable_card( | |||
| 1696 | pci_bus->number = func->bus; | 1696 | pci_bus->number = func->bus; |
| 1697 | devfn = PCI_DEVFN(func->device, func->function); | 1697 | devfn = PCI_DEVFN(func->device, func->function); |
| 1698 | 1698 | ||
| 1699 | rc = pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &command); | 1699 | rc = pci_bus_read_config_word(pci_bus, devfn, PCI_COMMAND, &cmd); |
| 1700 | 1700 | ||
| 1701 | if (card_type == PCI_HEADER_TYPE_BRIDGE) { | 1701 | if (card_type == PCI_HEADER_TYPE_BRIDGE) { |
| 1702 | rc = pci_bus_read_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, &bcommand); | 1702 | rc = pci_bus_read_config_word(pci_bus, devfn, PCI_BRIDGE_CONTROL, &bcmd); |
| 1703 | } | 1703 | } |
| 1704 | 1704 | ||
| 1705 | cmd = command = command | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE | 1705 | command = cmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE |
| 1706 | | PCI_COMMAND_IO | PCI_COMMAND_MEMORY; | 1706 | | PCI_COMMAND_IO | PCI_COMMAND_MEMORY; |
| 1707 | bcmd = bcommand = bcommand | PCI_BRIDGE_CTL_NO_ISA; | 1707 | bcommand = bcmd | PCI_BRIDGE_CTL_NO_ISA; |
| 1708 | 1708 | ||
| 1709 | ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); | 1709 | ab = find_acpi_bridge_by_bus(acpi_bridges_head, ctrl->seg, ctrl->bus); |
| 1710 | if (ab) { | 1710 | if (ab) { |
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c index 4ada15111af0..ad1017da8656 100644 --- a/drivers/pci/hotplug/rpadlpar_core.c +++ b/drivers/pci/hotplug/rpadlpar_core.c | |||
| @@ -134,7 +134,8 @@ static void rpadlpar_claim_one_bus(struct pci_bus *b) | |||
| 134 | static int pci_add_secondary_bus(struct device_node *dn, | 134 | static int pci_add_secondary_bus(struct device_node *dn, |
| 135 | struct pci_dev *bridge_dev) | 135 | struct pci_dev *bridge_dev) |
| 136 | { | 136 | { |
| 137 | struct pci_controller *hose = dn->phb; | 137 | struct pci_dn *pdn = dn->data; |
| 138 | struct pci_controller *hose = pdn->phb; | ||
| 138 | struct pci_bus *child; | 139 | struct pci_bus *child; |
| 139 | u8 sec_busno; | 140 | u8 sec_busno; |
| 140 | 141 | ||
| @@ -159,7 +160,7 @@ static int pci_add_secondary_bus(struct device_node *dn, | |||
| 159 | if (hose->last_busno < child->number) | 160 | if (hose->last_busno < child->number) |
| 160 | hose->last_busno = child->number; | 161 | hose->last_busno = child->number; |
| 161 | 162 | ||
| 162 | dn->bussubno = child->number; | 163 | pdn->bussubno = child->number; |
| 163 | 164 | ||
| 164 | /* ioremap() for child bus, which may or may not succeed */ | 165 | /* ioremap() for child bus, which may or may not succeed */ |
| 165 | remap_bus_range(child); | 166 | remap_bus_range(child); |
| @@ -183,11 +184,12 @@ static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent, | |||
| 183 | 184 | ||
| 184 | static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn) | 185 | static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn) |
| 185 | { | 186 | { |
| 186 | struct pci_controller *hose = dn->phb; | 187 | struct pci_dn *pdn = dn->data; |
| 188 | struct pci_controller *hose = pdn->phb; | ||
| 187 | struct pci_dev *dev = NULL; | 189 | struct pci_dev *dev = NULL; |
| 188 | 190 | ||
| 189 | /* Scan phb bus for EADS device, adding new one to bus->devices */ | 191 | /* Scan phb bus for EADS device, adding new one to bus->devices */ |
| 190 | if (!pci_scan_single_device(hose->bus, dn->devfn)) { | 192 | if (!pci_scan_single_device(hose->bus, pdn->devfn)) { |
| 191 | printk(KERN_ERR "%s: found no device on bus\n", __FUNCTION__); | 193 | printk(KERN_ERR "%s: found no device on bus\n", __FUNCTION__); |
| 192 | return NULL; | 194 | return NULL; |
| 193 | } | 195 | } |
| @@ -269,6 +271,7 @@ static int dlpar_remove_root_bus(struct pci_controller *phb) | |||
| 269 | static int dlpar_remove_phb(char *drc_name, struct device_node *dn) | 271 | static int dlpar_remove_phb(char *drc_name, struct device_node *dn) |
| 270 | { | 272 | { |
| 271 | struct slot *slot; | 273 | struct slot *slot; |
| 274 | struct pci_dn *pdn; | ||
| 272 | int rc = 0; | 275 | int rc = 0; |
| 273 | 276 | ||
| 274 | if (!rpaphp_find_pci_bus(dn)) | 277 | if (!rpaphp_find_pci_bus(dn)) |
| @@ -285,12 +288,13 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn) | |||
| 285 | } | 288 | } |
| 286 | } | 289 | } |
| 287 | 290 | ||
| 288 | BUG_ON(!dn->phb); | 291 | pdn = dn->data; |
| 289 | rc = dlpar_remove_root_bus(dn->phb); | 292 | BUG_ON(!pdn || !pdn->phb); |
| 293 | rc = dlpar_remove_root_bus(pdn->phb); | ||
| 290 | if (rc < 0) | 294 | if (rc < 0) |
| 291 | return rc; | 295 | return rc; |
| 292 | 296 | ||
| 293 | dn->phb = NULL; | 297 | pdn->phb = NULL; |
| 294 | 298 | ||
| 295 | return 0; | 299 | return 0; |
| 296 | } | 300 | } |
| @@ -299,7 +303,7 @@ static int dlpar_add_phb(char *drc_name, struct device_node *dn) | |||
| 299 | { | 303 | { |
| 300 | struct pci_controller *phb; | 304 | struct pci_controller *phb; |
| 301 | 305 | ||
| 302 | if (dn->phb) { | 306 | if (PCI_DN(dn)->phb) { |
| 303 | /* PHB already exists */ | 307 | /* PHB already exists */ |
| 304 | return -EINVAL; | 308 | return -EINVAL; |
| 305 | } | 309 | } |
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c index 17a0279ebcb9..49e4d10a6488 100644 --- a/drivers/pci/hotplug/rpaphp_pci.c +++ b/drivers/pci/hotplug/rpaphp_pci.c | |||
| @@ -51,10 +51,12 @@ static struct pci_bus *find_bus_among_children(struct pci_bus *bus, | |||
| 51 | 51 | ||
| 52 | struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn) | 52 | struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn) |
| 53 | { | 53 | { |
| 54 | if (!dn->phb || !dn->phb->bus) | 54 | struct pci_dn *pdn = dn->data; |
| 55 | |||
| 56 | if (!pdn || !pdn->phb || !pdn->phb->bus) | ||
| 55 | return NULL; | 57 | return NULL; |
| 56 | 58 | ||
| 57 | return find_bus_among_children(dn->phb->bus, dn); | 59 | return find_bus_among_children(pdn->phb->bus, dn); |
| 58 | } | 60 | } |
| 59 | EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus); | 61 | EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus); |
| 60 | 62 | ||
| @@ -229,7 +231,7 @@ rpaphp_pci_config_slot(struct pci_bus *bus) | |||
| 229 | if (!dn || !dn->child) | 231 | if (!dn || !dn->child) |
| 230 | return NULL; | 232 | return NULL; |
| 231 | 233 | ||
| 232 | slotno = PCI_SLOT(dn->child->devfn); | 234 | slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); |
| 233 | 235 | ||
| 234 | /* pci_scan_slot should find all children */ | 236 | /* pci_scan_slot should find all children */ |
| 235 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); | 237 | num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); |
