diff options
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_pci.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_pci.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index e220d49307bd..1b2b3f3b648b 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c | |||
@@ -1,3 +1,4 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0+ | ||
1 | /* | 2 | /* |
2 | * Compaq Hot Plug Controller Driver | 3 | * Compaq Hot Plug Controller Driver |
3 | * | 4 | * |
@@ -7,21 +8,6 @@ | |||
7 | * | 8 | * |
8 | * All rights reserved. | 9 | * All rights reserved. |
9 | * | 10 | * |
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or (at | ||
13 | * your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but | ||
16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
18 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
19 | * details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | * | ||
25 | * Send feedback to <greg@kroah.com> | 11 | * Send feedback to <greg@kroah.com> |
26 | * | 12 | * |
27 | */ | 13 | */ |
@@ -89,7 +75,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func) | |||
89 | pci_lock_rescan_remove(); | 75 | pci_lock_rescan_remove(); |
90 | 76 | ||
91 | if (func->pci_dev == NULL) | 77 | if (func->pci_dev == NULL) |
92 | func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function)); | 78 | func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, |
79 | PCI_DEVFN(func->device, | ||
80 | func->function)); | ||
93 | 81 | ||
94 | /* No pci device, we need to create it then */ | 82 | /* No pci device, we need to create it then */ |
95 | if (func->pci_dev == NULL) { | 83 | if (func->pci_dev == NULL) { |
@@ -99,7 +87,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func) | |||
99 | if (num) | 87 | if (num) |
100 | pci_bus_add_devices(ctrl->pci_dev->bus); | 88 | pci_bus_add_devices(ctrl->pci_dev->bus); |
101 | 89 | ||
102 | func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function)); | 90 | func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, |
91 | PCI_DEVFN(func->device, | ||
92 | func->function)); | ||
103 | if (func->pci_dev == NULL) { | 93 | if (func->pci_dev == NULL) { |
104 | dbg("ERROR: pci_dev still null\n"); | 94 | dbg("ERROR: pci_dev still null\n"); |
105 | goto out; | 95 | goto out; |
@@ -129,7 +119,10 @@ int cpqhp_unconfigure_device(struct pci_func *func) | |||
129 | 119 | ||
130 | pci_lock_rescan_remove(); | 120 | pci_lock_rescan_remove(); |
131 | for (j = 0; j < 8 ; j++) { | 121 | for (j = 0; j < 8 ; j++) { |
132 | struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); | 122 | struct pci_dev *temp = pci_get_domain_bus_and_slot(0, |
123 | func->bus, | ||
124 | PCI_DEVFN(func->device, | ||
125 | j)); | ||
133 | if (temp) { | 126 | if (temp) { |
134 | pci_dev_put(temp); | 127 | pci_dev_put(temp); |
135 | pci_stop_and_remove_bus_device(temp); | 128 | pci_stop_and_remove_bus_device(temp); |
@@ -319,6 +312,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) | |||
319 | int cloop = 0; | 312 | int cloop = 0; |
320 | int stop_it; | 313 | int stop_it; |
321 | int index; | 314 | int index; |
315 | u16 devfn; | ||
322 | 316 | ||
323 | /* Decide which slots are supported */ | 317 | /* Decide which slots are supported */ |
324 | 318 | ||
@@ -416,7 +410,9 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) | |||
416 | new_slot->switch_save = 0x10; | 410 | new_slot->switch_save = 0x10; |
417 | /* In case of unsupported board */ | 411 | /* In case of unsupported board */ |
418 | new_slot->status = DevError; | 412 | new_slot->status = DevError; |
419 | new_slot->pci_dev = pci_get_bus_and_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function); | 413 | devfn = (new_slot->device << 3) | new_slot->function; |
414 | new_slot->pci_dev = pci_get_domain_bus_and_slot(0, | ||
415 | new_slot->bus, devfn); | ||
420 | 416 | ||
421 | for (cloop = 0; cloop < 0x20; cloop++) { | 417 | for (cloop = 0; cloop < 0x20; cloop++) { |
422 | rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop])); | 418 | rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop])); |