aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-11-14 13:28:18 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-11-14 13:28:18 -0500
commitf7625980f5820edd1a73536e1a03bcbc1f889fec (patch)
tree145e76f39b3e1d08d3e7a48a0993c0cd59088cc6 /drivers/pci/hotplug
parent4fbf888accb39af423f271111d44e8186f053723 (diff)
PCI: Fix whitespace, capitalization, and spelling errors
Fix whitespace, capitalization, and spelling errors. No functional change. I know "busses" is not an error, but "buses" was more common, so I used it consistently. Signed-off-by: Marta Rybczynska <rybczynska@gmail.com> (pci_reset_bridge_secondary_bus()) Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/Kconfig4
-rw-r--r--drivers/pci/hotplug/Makefile2
-rw-r--r--drivers/pci/hotplug/acpiphp_core.c12
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c2
-rw-r--r--drivers/pci/hotplug/acpiphp_ibm.c14
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_core.c2
-rw-r--r--drivers/pci/hotplug/cpci_hotplug_pci.c2
-rw-r--r--drivers/pci/hotplug/cpcihp_generic.c20
-rw-r--r--drivers/pci/hotplug/cpcihp_zt5550.c22
-rw-r--r--drivers/pci/hotplug/cpcihp_zt5550.h18
-rw-r--r--drivers/pci/hotplug/cpqphp_core.c4
-rw-r--r--drivers/pci/hotplug/cpqphp_ctrl.c10
-rw-r--r--drivers/pci/hotplug/cpqphp_pci.c5
-rw-r--r--drivers/pci/hotplug/ibmphp.h12
-rw-r--r--drivers/pci/hotplug/ibmphp_core.c109
-rw-r--r--drivers/pci/hotplug/ibmphp_ebda.c103
-rw-r--r--drivers/pci/hotplug/ibmphp_hpc.c24
-rw-r--r--drivers/pci/hotplug/ibmphp_pci.c71
-rw-r--r--drivers/pci/hotplug/ibmphp_res.c76
-rw-r--r--drivers/pci/hotplug/pci_hotplug_core.c8
-rw-r--r--drivers/pci/hotplug/pciehp.h2
-rw-r--r--drivers/pci/hotplug/pciehp_acpi.c2
-rw-r--r--drivers/pci/hotplug/pciehp_core.c4
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c6
-rw-r--r--drivers/pci/hotplug/pcihp_skeleton.c8
-rw-r--r--drivers/pci/hotplug/rpadlpar_core.c2
-rw-r--r--drivers/pci/hotplug/rpaphp.h6
-rw-r--r--drivers/pci/hotplug/rpaphp_core.c8
-rw-r--r--drivers/pci/hotplug/rpaphp_pci.c3
-rw-r--r--drivers/pci/hotplug/rpaphp_slot.c19
-rw-r--r--drivers/pci/hotplug/shpchp.h8
-rw-r--r--drivers/pci/hotplug/shpchp_core.c10
-rw-r--r--drivers/pci/hotplug/shpchp_hpc.c2
33 files changed, 298 insertions, 302 deletions
diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 0a648af89531..df8caec59789 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -133,8 +133,8 @@ config HOTPLUG_PCI_RPA_DLPAR
133 133
134 To compile this driver as a module, choose M here: the 134 To compile this driver as a module, choose M here: the
135 module will be called rpadlpar_io. 135 module will be called rpadlpar_io.
136 136
137 When in doubt, say N. 137 When in doubt, say N.
138 138
139config HOTPLUG_PCI_SGI 139config HOTPLUG_PCI_SGI
140 tristate "SGI PCI Hotplug Support" 140 tristate "SGI PCI Hotplug Support"
diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index 47ec8c80e16d..3e6532b945c1 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -31,7 +31,7 @@ pci_hotplug-objs += cpci_hotplug_core.o \
31 cpci_hotplug_pci.o 31 cpci_hotplug_pci.o
32endif 32endif
33ifdef CONFIG_ACPI 33ifdef CONFIG_ACPI
34pci_hotplug-objs += acpi_pcihp.o 34pci_hotplug-objs += acpi_pcihp.o
35endif 35endif
36 36
37cpqphp-objs := cpqphp_core.o \ 37cpqphp-objs := cpqphp_core.o \
diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c
index 8650d39db392..dca66bc44578 100644
--- a/drivers/pci/hotplug/acpiphp_core.c
+++ b/drivers/pci/hotplug/acpiphp_core.c
@@ -111,7 +111,7 @@ int acpiphp_register_attention(struct acpiphp_attention_info *info)
111 * @info: must match the pointer used to register 111 * @info: must match the pointer used to register
112 * 112 *
113 * Description: This is used to un-register a hardware specific acpi 113 * Description: This is used to un-register a hardware specific acpi
114 * driver that manipulates the attention LED. The pointer to the 114 * driver that manipulates the attention LED. The pointer to the
115 * info struct must be the same as the one used to set it. 115 * info struct must be the same as the one used to set it.
116 */ 116 */
117int acpiphp_unregister_attention(struct acpiphp_attention_info *info) 117int acpiphp_unregister_attention(struct acpiphp_attention_info *info)
@@ -169,8 +169,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
169 * was registered with us. This allows hardware specific 169 * was registered with us. This allows hardware specific
170 * ACPI implementations to blink the light for us. 170 * ACPI implementations to blink the light for us.
171 */ 171 */
172 static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) 172static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
173 { 173{
174 int retval = -ENODEV; 174 int retval = -ENODEV;
175 175
176 pr_debug("%s - physical_slot = %s\n", __func__, 176 pr_debug("%s - physical_slot = %s\n", __func__,
@@ -182,8 +182,8 @@ static int disable_slot(struct hotplug_slot *hotplug_slot)
182 } else 182 } else
183 attention_info = NULL; 183 attention_info = NULL;
184 return retval; 184 return retval;
185 } 185}
186 186
187 187
188/** 188/**
189 * get_power_status - get power status of a slot 189 * get_power_status - get power status of a slot
@@ -323,7 +323,7 @@ int acpiphp_register_hotplug_slot(struct acpiphp_slot *acpiphp_slot,
323 if (retval) { 323 if (retval) {
324 pr_err("pci_hp_register failed with error %d\n", retval); 324 pr_err("pci_hp_register failed with error %d\n", retval);
325 goto error_hpslot; 325 goto error_hpslot;
326 } 326 }
327 327
328 pr_info("Slot [%s] registered\n", slot_name(slot)); 328 pr_info("Slot [%s] registered\n", slot_name(slot));
329 329
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 5b4e9eb0e8ff..1cf605f67673 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -325,7 +325,7 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
325 325
326 list_add_tail(&slot->node, &bridge->slots); 326 list_add_tail(&slot->node, &bridge->slots);
327 327
328 /* Register slots for ejectable funtions only. */ 328 /* Register slots for ejectable functions only. */
329 if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) { 329 if (acpi_pci_check_ejectable(pbus, handle) || is_dock_device(handle)) {
330 unsigned long long sun; 330 unsigned long long sun;
331 int retval; 331 int retval;
diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
index 0d64c414bf78..ecfac7e72d91 100644
--- a/drivers/pci/hotplug/acpiphp_ibm.c
+++ b/drivers/pci/hotplug/acpiphp_ibm.c
@@ -116,7 +116,7 @@ static struct bin_attribute ibm_apci_table_attr = {
116 .read = ibm_read_apci_table, 116 .read = ibm_read_apci_table,
117 .write = NULL, 117 .write = NULL,
118}; 118};
119static struct acpiphp_attention_info ibm_attention_info = 119static struct acpiphp_attention_info ibm_attention_info =
120{ 120{
121 .set_attn = ibm_set_attention_status, 121 .set_attn = ibm_set_attention_status,
122 .get_attn = ibm_get_attention_status, 122 .get_attn = ibm_get_attention_status,
@@ -171,9 +171,9 @@ ibm_slot_done:
171 */ 171 */
172static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status) 172static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
173{ 173{
174 union acpi_object args[2]; 174 union acpi_object args[2];
175 struct acpi_object_list params = { .pointer = args, .count = 2 }; 175 struct acpi_object_list params = { .pointer = args, .count = 2 };
176 acpi_status stat; 176 acpi_status stat;
177 unsigned long long rc; 177 unsigned long long rc;
178 union apci_descriptor *ibm_slot; 178 union apci_descriptor *ibm_slot;
179 179
@@ -208,7 +208,7 @@ static int ibm_set_attention_status(struct hotplug_slot *slot, u8 status)
208 * 208 *
209 * Description: This method is registered with the acpiphp module as a 209 * Description: This method is registered with the acpiphp module as a
210 * callback to do the device specific task of getting the LED status. 210 * callback to do the device specific task of getting the LED status.
211 * 211 *
212 * Because there is no direct method of getting the LED status directly 212 * Because there is no direct method of getting the LED status directly
213 * from an ACPI call, we read the aPCI table and parse out our 213 * from an ACPI call, we read the aPCI table and parse out our
214 * slot descriptor to read the status from that. 214 * slot descriptor to read the status from that.
@@ -259,7 +259,7 @@ static void ibm_handle_events(acpi_handle handle, u32 event, void *context)
259 pr_debug("%s: Received notification %02x\n", __func__, event); 259 pr_debug("%s: Received notification %02x\n", __func__, event);
260 260
261 if (subevent == 0x80) { 261 if (subevent == 0x80) {
262 pr_debug("%s: generationg bus event\n", __func__); 262 pr_debug("%s: generating bus event\n", __func__);
263 acpi_bus_generate_netlink_event(note->device->pnp.device_class, 263 acpi_bus_generate_netlink_event(note->device->pnp.device_class,
264 dev_name(&note->device->dev), 264 dev_name(&note->device->dev),
265 note->event, detail); 265 note->event, detail);
@@ -387,7 +387,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
387 u32 lvl, void *context, void **rv) 387 u32 lvl, void *context, void **rv)
388{ 388{
389 acpi_handle *phandle = (acpi_handle *)context; 389 acpi_handle *phandle = (acpi_handle *)context;
390 acpi_status status; 390 acpi_status status;
391 struct acpi_device_info *info; 391 struct acpi_device_info *info;
392 int retval = 0; 392 int retval = 0;
393 393
@@ -405,7 +405,7 @@ static acpi_status __init ibm_find_acpi_device(acpi_handle handle,
405 info->hardware_id.string, handle); 405 info->hardware_id.string, handle);
406 *phandle = handle; 406 *phandle = handle;
407 /* returning non-zero causes the search to stop 407 /* returning non-zero causes the search to stop
408 * and returns this value to the caller of 408 * and returns this value to the caller of
409 * acpi_walk_namespace, but it also causes some warnings 409 * acpi_walk_namespace, but it also causes some warnings
410 * in the acpi debug code to print... 410 * in the acpi debug code to print...
411 */ 411 */
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c
index 2b4c412f94c3..00c81a3cefc9 100644
--- a/drivers/pci/hotplug/cpci_hotplug_core.c
+++ b/drivers/pci/hotplug/cpci_hotplug_core.c
@@ -46,7 +46,7 @@
46 do { \ 46 do { \
47 if (cpci_debug) \ 47 if (cpci_debug) \
48 printk (KERN_DEBUG "%s: " format "\n", \ 48 printk (KERN_DEBUG "%s: " format "\n", \
49 MY_NAME , ## arg); \ 49 MY_NAME , ## arg); \
50 } while (0) 50 } while (0)
51#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 51#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
52#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 52#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
diff --git a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c
index d8add34177f2..d3add9819f63 100644
--- a/drivers/pci/hotplug/cpci_hotplug_pci.c
+++ b/drivers/pci/hotplug/cpci_hotplug_pci.c
@@ -39,7 +39,7 @@ extern int cpci_debug;
39 do { \ 39 do { \
40 if (cpci_debug) \ 40 if (cpci_debug) \
41 printk (KERN_DEBUG "%s: " format "\n", \ 41 printk (KERN_DEBUG "%s: " format "\n", \
42 MY_NAME , ## arg); \ 42 MY_NAME , ## arg); \
43 } while (0) 43 } while (0)
44#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 44#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
45#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 45#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
diff --git a/drivers/pci/hotplug/cpcihp_generic.c b/drivers/pci/hotplug/cpcihp_generic.c
index a6a71c41cdf8..7536eef620b0 100644
--- a/drivers/pci/hotplug/cpcihp_generic.c
+++ b/drivers/pci/hotplug/cpcihp_generic.c
@@ -13,14 +13,14 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 * You should have received a copy of the GNU General Public License along 26 * You should have received a copy of the GNU General Public License along
@@ -53,9 +53,9 @@
53 53
54#define dbg(format, arg...) \ 54#define dbg(format, arg...) \
55 do { \ 55 do { \
56 if(debug) \ 56 if (debug) \
57 printk (KERN_DEBUG "%s: " format "\n", \ 57 printk (KERN_DEBUG "%s: " format "\n", \
58 MY_NAME , ## arg); \ 58 MY_NAME , ## arg); \
59 } while(0) 59 } while(0)
60#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 60#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
61#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 61#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c
index 449b4bbc8301..e8c4a7ccf578 100644
--- a/drivers/pci/hotplug/cpcihp_zt5550.c
+++ b/drivers/pci/hotplug/cpcihp_zt5550.c
@@ -13,14 +13,14 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 * You should have received a copy of the GNU General Public License along 26 * You should have received a copy of the GNU General Public License along
@@ -48,9 +48,9 @@
48 48
49#define dbg(format, arg...) \ 49#define dbg(format, arg...) \
50 do { \ 50 do { \
51 if(debug) \ 51 if (debug) \
52 printk (KERN_DEBUG "%s: " format "\n", \ 52 printk (KERN_DEBUG "%s: " format "\n", \
53 MY_NAME , ## arg); \ 53 MY_NAME , ## arg); \
54 } while(0) 54 } while(0)
55#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 55#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
56#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 56#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
@@ -285,7 +285,7 @@ static struct pci_device_id zt5550_hc_pci_tbl[] = {
285 { 0, } 285 { 0, }
286}; 286};
287MODULE_DEVICE_TABLE(pci, zt5550_hc_pci_tbl); 287MODULE_DEVICE_TABLE(pci, zt5550_hc_pci_tbl);
288 288
289static struct pci_driver zt5550_hc_driver = { 289static struct pci_driver zt5550_hc_driver = {
290 .name = "zt5550_hc", 290 .name = "zt5550_hc",
291 .id_table = zt5550_hc_pci_tbl, 291 .id_table = zt5550_hc_pci_tbl,
diff --git a/drivers/pci/hotplug/cpcihp_zt5550.h b/drivers/pci/hotplug/cpcihp_zt5550.h
index bebc6060a558..9a57fda5348c 100644
--- a/drivers/pci/hotplug/cpcihp_zt5550.h
+++ b/drivers/pci/hotplug/cpcihp_zt5550.h
@@ -13,14 +13,14 @@
13 * option) any later version. 13 * option) any later version.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 15 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 16 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 17 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 22 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 * You should have received a copy of the GNU General Public License along 26 * You should have received a copy of the GNU General Public License along
@@ -55,7 +55,7 @@
55#define HC_CMD_REG 0x0C 55#define HC_CMD_REG 0x0C
56#define ARB_CONFIG_GNT_REG 0x10 56#define ARB_CONFIG_GNT_REG 0x10
57#define ARB_CONFIG_CFG_REG 0x12 57#define ARB_CONFIG_CFG_REG 0x12
58#define ARB_CONFIG_REG 0x10 58#define ARB_CONFIG_REG 0x10
59#define ISOL_CONFIG_REG 0x18 59#define ISOL_CONFIG_REG 0x18
60#define FAULT_STATUS_REG 0x20 60#define FAULT_STATUS_REG 0x20
61#define FAULT_CONFIG_REG 0x24 61#define FAULT_CONFIG_REG 0x24
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c
index c8eaeb43fa5d..31273e155e6c 100644
--- a/drivers/pci/hotplug/cpqphp_core.c
+++ b/drivers/pci/hotplug/cpqphp_core.c
@@ -862,10 +862,10 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
862 goto err_disable_device; 862 goto err_disable_device;
863 } 863 }
864 864
865 /* Check for the proper subsystem ID's 865 /* Check for the proper subsystem IDs
866 * Intel uses a different SSID programming model than Compaq. 866 * Intel uses a different SSID programming model than Compaq.
867 * For Intel, each SSID bit identifies a PHP capability. 867 * For Intel, each SSID bit identifies a PHP capability.
868 * Also Intel HPC's may have RID=0. 868 * Also Intel HPCs may have RID=0.
869 */ 869 */
870 if ((pdev->revision <= 2) && (vendor_id != PCI_VENDOR_ID_INTEL)) { 870 if ((pdev->revision <= 2) && (vendor_id != PCI_VENDOR_ID_INTEL)) {
871 err(msg_HPC_not_supported); 871 err(msg_HPC_not_supported);
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
index d282019cda5f..11845b796799 100644
--- a/drivers/pci/hotplug/cpqphp_ctrl.c
+++ b/drivers/pci/hotplug/cpqphp_ctrl.c
@@ -1231,7 +1231,7 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_
1231 1231
1232 /* Only if mode change...*/ 1232 /* Only if mode change...*/
1233 if (((bus->cur_bus_speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || 1233 if (((bus->cur_bus_speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) ||
1234 ((bus->cur_bus_speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) 1234 ((bus->cur_bus_speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz)))
1235 set_SOGO(ctrl); 1235 set_SOGO(ctrl);
1236 1236
1237 wait_for_ctrl_irq(ctrl); 1237 wait_for_ctrl_irq(ctrl);
@@ -1828,7 +1828,7 @@ static void interrupt_event_handler(struct controller *ctrl)
1828 1828
1829 if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) { 1829 if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) {
1830 dbg("button pressed\n"); 1830 dbg("button pressed\n");
1831 } else if (ctrl->event_queue[loop].event_type == 1831 } else if (ctrl->event_queue[loop].event_type ==
1832 INT_BUTTON_CANCEL) { 1832 INT_BUTTON_CANCEL) {
1833 dbg("button cancel\n"); 1833 dbg("button cancel\n");
1834 del_timer(&p_slot->task_event); 1834 del_timer(&p_slot->task_event);
@@ -2411,11 +2411,11 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
2411 if (rc) 2411 if (rc)
2412 return rc; 2412 return rc;
2413 2413
2414 /* find range of busses to use */ 2414 /* find range of buses to use */
2415 dbg("find ranges of buses to use\n"); 2415 dbg("find ranges of buses to use\n");
2416 bus_node = get_max_resource(&(resources->bus_head), 1); 2416 bus_node = get_max_resource(&(resources->bus_head), 1);
2417 2417
2418 /* If we don't have any busses to allocate, we can't continue */ 2418 /* If we don't have any buses to allocate, we can't continue */
2419 if (!bus_node) 2419 if (!bus_node)
2420 return -ENOMEM; 2420 return -ENOMEM;
2421 2421
@@ -2900,7 +2900,7 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func
2900 2900
2901 /* If this function needs an interrupt and we are behind 2901 /* If this function needs an interrupt and we are behind
2902 * a bridge and the pin is tied to something that's 2902 * a bridge and the pin is tied to something that's
2903 * alread mapped, set this one the same */ 2903 * already mapped, set this one the same */
2904 if (temp_byte && resources->irqs && 2904 if (temp_byte && resources->irqs &&
2905 (resources->irqs->valid_INT & 2905 (resources->irqs->valid_INT &
2906 (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { 2906 (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) {
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index 09801c6945ce..6e4a12c91adb 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -291,7 +291,7 @@ int cpqhp_get_bus_dev (struct controller *ctrl, u8 * bus_num, u8 * dev_num, u8 s
291 * 291 *
292 * Reads configuration for all slots in a PCI bus and saves info. 292 * Reads configuration for all slots in a PCI bus and saves info.
293 * 293 *
294 * Note: For non-hot plug busses, the slot # saved is the device # 294 * Note: For non-hot plug buses, the slot # saved is the device #
295 * 295 *
296 * returns 0 if success 296 * returns 0 if success
297 */ 297 */
@@ -455,7 +455,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
455 * cpqhp_save_slot_config 455 * cpqhp_save_slot_config
456 * 456 *
457 * Saves configuration info for all PCI devices in a given slot 457 * Saves configuration info for all PCI devices in a given slot
458 * including subordinate busses. 458 * including subordinate buses.
459 * 459 *
460 * returns 0 if success 460 * returns 0 if success
461 */ 461 */
@@ -1556,4 +1556,3 @@ void cpqhp_destroy_board_resources (struct pci_func * func)
1556 kfree(tres); 1556 kfree(tres);
1557 } 1557 }
1558} 1558}
1559
diff --git a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h
index 8c5b25871d02..e3e46a7b3ee7 100644
--- a/drivers/pci/hotplug/ibmphp.h
+++ b/drivers/pci/hotplug/ibmphp.h
@@ -59,7 +59,7 @@ extern int ibmphp_debug;
59 59
60 60
61/************************************************************ 61/************************************************************
62* RESOURE TYPE * 62* RESOURCE TYPE *
63************************************************************/ 63************************************************************/
64 64
65#define EBDA_RSRC_TYPE_MASK 0x03 65#define EBDA_RSRC_TYPE_MASK 0x03
@@ -103,7 +103,7 @@ extern int ibmphp_debug;
103//-------------------------------------------------------------- 103//--------------------------------------------------------------
104 104
105struct rio_table_hdr { 105struct rio_table_hdr {
106 u8 ver_num; 106 u8 ver_num;
107 u8 scal_count; 107 u8 scal_count;
108 u8 riodev_count; 108 u8 riodev_count;
109 u16 offset; 109 u16 offset;
@@ -127,7 +127,7 @@ struct scal_detail {
127}; 127};
128 128
129//-------------------------------------------------------------- 129//--------------------------------------------------------------
130// RIO DETAIL 130// RIO DETAIL
131//-------------------------------------------------------------- 131//--------------------------------------------------------------
132 132
133struct rio_detail { 133struct rio_detail {
@@ -152,7 +152,7 @@ struct opt_rio {
152 u8 first_slot_num; 152 u8 first_slot_num;
153 u8 middle_num; 153 u8 middle_num;
154 struct list_head opt_rio_list; 154 struct list_head opt_rio_list;
155}; 155};
156 156
157struct opt_rio_lo { 157struct opt_rio_lo {
158 u8 rio_type; 158 u8 rio_type;
@@ -161,7 +161,7 @@ struct opt_rio_lo {
161 u8 middle_num; 161 u8 middle_num;
162 u8 pack_count; 162 u8 pack_count;
163 struct list_head opt_rio_lo_list; 163 struct list_head opt_rio_lo_list;
164}; 164};
165 165
166/**************************************************************** 166/****************************************************************
167* HPC DESCRIPTOR NODE * 167* HPC DESCRIPTOR NODE *
@@ -574,7 +574,7 @@ void ibmphp_hpc_stop_poll_thread(void);
574#define HPC_CTLR_IRQ_PENDG 0x80 574#define HPC_CTLR_IRQ_PENDG 0x80
575 575
576//---------------------------------------------------------------------------- 576//----------------------------------------------------------------------------
577// HPC_CTLR_WROKING status return codes 577// HPC_CTLR_WORKING status return codes
578//---------------------------------------------------------------------------- 578//----------------------------------------------------------------------------
579#define HPC_CTLR_WORKING_NO 0x00 579#define HPC_CTLR_WORKING_NO 0x00
580#define HPC_CTLR_WORKING_YES 0x01 580#define HPC_CTLR_WORKING_YES 0x01
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index cbd72d81d253..efdc13adbe41 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -58,7 +58,7 @@ MODULE_DESCRIPTION (DRIVER_DESC);
58struct pci_bus *ibmphp_pci_bus; 58struct pci_bus *ibmphp_pci_bus;
59static int max_slots; 59static int max_slots;
60 60
61static int irqs[16]; /* PIC mode IRQ's we're using so far (in case MPS 61static int irqs[16]; /* PIC mode IRQs we're using so far (in case MPS
62 * tables don't provide default info for empty slots */ 62 * tables don't provide default info for empty slots */
63 63
64static int init_flag; 64static int init_flag;
@@ -71,20 +71,20 @@ static inline int get_max_adapter_speed (struct hotplug_slot *hs, u8 *value)
71 return get_max_adapter_speed_1 (hs, value, 1); 71 return get_max_adapter_speed_1 (hs, value, 1);
72} 72}
73*/ 73*/
74static inline int get_cur_bus_info(struct slot **sl) 74static inline int get_cur_bus_info(struct slot **sl)
75{ 75{
76 int rc = 1; 76 int rc = 1;
77 struct slot * slot_cur = *sl; 77 struct slot * slot_cur = *sl;
78 78
79 debug("options = %x\n", slot_cur->ctrl->options); 79 debug("options = %x\n", slot_cur->ctrl->options);
80 debug("revision = %x\n", slot_cur->ctrl->revision); 80 debug("revision = %x\n", slot_cur->ctrl->revision);
81 81
82 if (READ_BUS_STATUS(slot_cur->ctrl)) 82 if (READ_BUS_STATUS(slot_cur->ctrl))
83 rc = ibmphp_hpc_readslot(slot_cur, READ_BUSSTATUS, NULL); 83 rc = ibmphp_hpc_readslot(slot_cur, READ_BUSSTATUS, NULL);
84 84
85 if (rc) 85 if (rc)
86 return rc; 86 return rc;
87 87
88 slot_cur->bus_on->current_speed = CURRENT_BUS_SPEED(slot_cur->busstatus); 88 slot_cur->bus_on->current_speed = CURRENT_BUS_SPEED(slot_cur->busstatus);
89 if (READ_BUS_MODE(slot_cur->ctrl)) 89 if (READ_BUS_MODE(slot_cur->ctrl))
90 slot_cur->bus_on->current_bus_mode = 90 slot_cur->bus_on->current_bus_mode =
@@ -96,7 +96,7 @@ static inline int get_cur_bus_info(struct slot **sl)
96 slot_cur->busstatus, 96 slot_cur->busstatus,
97 slot_cur->bus_on->current_speed, 97 slot_cur->bus_on->current_speed,
98 slot_cur->bus_on->current_bus_mode); 98 slot_cur->bus_on->current_bus_mode);
99 99
100 *sl = slot_cur; 100 *sl = slot_cur;
101 return 0; 101 return 0;
102} 102}
@@ -104,8 +104,8 @@ static inline int get_cur_bus_info(struct slot **sl)
104static inline int slot_update(struct slot **sl) 104static inline int slot_update(struct slot **sl)
105{ 105{
106 int rc; 106 int rc;
107 rc = ibmphp_hpc_readslot(*sl, READ_ALLSTAT, NULL); 107 rc = ibmphp_hpc_readslot(*sl, READ_ALLSTAT, NULL);
108 if (rc) 108 if (rc)
109 return rc; 109 return rc;
110 if (!init_flag) 110 if (!init_flag)
111 rc = get_cur_bus_info(sl); 111 rc = get_cur_bus_info(sl);
@@ -172,7 +172,7 @@ int ibmphp_init_devno(struct slot **cur_slot)
172 debug("(*cur_slot)->irq[3] = %x\n", 172 debug("(*cur_slot)->irq[3] = %x\n",
173 (*cur_slot)->irq[3]); 173 (*cur_slot)->irq[3]);
174 174
175 debug("rtable->exlusive_irqs = %x\n", 175 debug("rtable->exclusive_irqs = %x\n",
176 rtable->exclusive_irqs); 176 rtable->exclusive_irqs);
177 debug("rtable->slots[loop].irq[0].bitmap = %x\n", 177 debug("rtable->slots[loop].irq[0].bitmap = %x\n",
178 rtable->slots[loop].irq[0].bitmap); 178 rtable->slots[loop].irq[0].bitmap);
@@ -271,7 +271,7 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 value)
271 else 271 else
272 rc = -ENODEV; 272 rc = -ENODEV;
273 } 273 }
274 } else 274 } else
275 rc = -ENODEV; 275 rc = -ENODEV;
276 276
277 ibmphp_unlock_operations(); 277 ibmphp_unlock_operations();
@@ -288,7 +288,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 * value)
288 288
289 debug("get_attention_status - Entry hotplug_slot[%lx] pvalue[%lx]\n", 289 debug("get_attention_status - Entry hotplug_slot[%lx] pvalue[%lx]\n",
290 (ulong) hotplug_slot, (ulong) value); 290 (ulong) hotplug_slot, (ulong) value);
291 291
292 ibmphp_lock_operations(); 292 ibmphp_lock_operations();
293 if (hotplug_slot) { 293 if (hotplug_slot) {
294 pslot = hotplug_slot->private; 294 pslot = hotplug_slot->private;
@@ -406,14 +406,14 @@ static int get_max_bus_speed(struct slot *slot)
406 406
407 ibmphp_lock_operations(); 407 ibmphp_lock_operations();
408 mode = slot->supported_bus_mode; 408 mode = slot->supported_bus_mode;
409 speed = slot->supported_speed; 409 speed = slot->supported_speed;
410 ibmphp_unlock_operations(); 410 ibmphp_unlock_operations();
411 411
412 switch (speed) { 412 switch (speed) {
413 case BUS_SPEED_33: 413 case BUS_SPEED_33:
414 break; 414 break;
415 case BUS_SPEED_66: 415 case BUS_SPEED_66:
416 if (mode == BUS_MODE_PCIX) 416 if (mode == BUS_MODE_PCIX)
417 speed += 0x01; 417 speed += 0x01;
418 break; 418 break;
419 case BUS_SPEED_100: 419 case BUS_SPEED_100:
@@ -515,13 +515,13 @@ static int __init init_ops(void)
515 515
516 debug("BEFORE GETTING SLOT STATUS, slot # %x\n", 516 debug("BEFORE GETTING SLOT STATUS, slot # %x\n",
517 slot_cur->number); 517 slot_cur->number);
518 if (slot_cur->ctrl->revision == 0xFF) 518 if (slot_cur->ctrl->revision == 0xFF)
519 if (get_ctrl_revision(slot_cur, 519 if (get_ctrl_revision(slot_cur,
520 &slot_cur->ctrl->revision)) 520 &slot_cur->ctrl->revision))
521 return -1; 521 return -1;
522 522
523 if (slot_cur->bus_on->current_speed == 0xFF) 523 if (slot_cur->bus_on->current_speed == 0xFF)
524 if (get_cur_bus_info(&slot_cur)) 524 if (get_cur_bus_info(&slot_cur))
525 return -1; 525 return -1;
526 get_max_bus_speed(slot_cur); 526 get_max_bus_speed(slot_cur);
527 527
@@ -539,8 +539,8 @@ static int __init init_ops(void)
539 debug("SLOT_PRESENT = %x\n", SLOT_PRESENT(slot_cur->status)); 539 debug("SLOT_PRESENT = %x\n", SLOT_PRESENT(slot_cur->status));
540 debug("SLOT_LATCH = %x\n", SLOT_LATCH(slot_cur->status)); 540 debug("SLOT_LATCH = %x\n", SLOT_LATCH(slot_cur->status));
541 541
542 if ((SLOT_PWRGD(slot_cur->status)) && 542 if ((SLOT_PWRGD(slot_cur->status)) &&
543 !(SLOT_PRESENT(slot_cur->status)) && 543 !(SLOT_PRESENT(slot_cur->status)) &&
544 !(SLOT_LATCH(slot_cur->status))) { 544 !(SLOT_LATCH(slot_cur->status))) {
545 debug("BEFORE POWER OFF COMMAND\n"); 545 debug("BEFORE POWER OFF COMMAND\n");
546 rc = power_off(slot_cur); 546 rc = power_off(slot_cur);
@@ -581,13 +581,13 @@ static int validate(struct slot *slot_cur, int opn)
581 581
582 switch (opn) { 582 switch (opn) {
583 case ENABLE: 583 case ENABLE:
584 if (!(SLOT_PWRGD(slot_cur->status)) && 584 if (!(SLOT_PWRGD(slot_cur->status)) &&
585 (SLOT_PRESENT(slot_cur->status)) && 585 (SLOT_PRESENT(slot_cur->status)) &&
586 !(SLOT_LATCH(slot_cur->status))) 586 !(SLOT_LATCH(slot_cur->status)))
587 return 0; 587 return 0;
588 break; 588 break;
589 case DISABLE: 589 case DISABLE:
590 if ((SLOT_PWRGD(slot_cur->status)) && 590 if ((SLOT_PWRGD(slot_cur->status)) &&
591 (SLOT_PRESENT(slot_cur->status)) && 591 (SLOT_PRESENT(slot_cur->status)) &&
592 !(SLOT_LATCH(slot_cur->status))) 592 !(SLOT_LATCH(slot_cur->status)))
593 return 0; 593 return 0;
@@ -617,7 +617,7 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
617 err("out of system memory\n"); 617 err("out of system memory\n");
618 return -ENOMEM; 618 return -ENOMEM;
619 } 619 }
620 620
621 info->power_status = SLOT_PWRGD(slot_cur->status); 621 info->power_status = SLOT_PWRGD(slot_cur->status);
622 info->attention_status = SLOT_ATTN(slot_cur->status, 622 info->attention_status = SLOT_ATTN(slot_cur->status,
623 slot_cur->ext_status); 623 slot_cur->ext_status);
@@ -638,7 +638,7 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
638 case BUS_SPEED_33: 638 case BUS_SPEED_33:
639 break; 639 break;
640 case BUS_SPEED_66: 640 case BUS_SPEED_66:
641 if (mode == BUS_MODE_PCIX) 641 if (mode == BUS_MODE_PCIX)
642 bus_speed += 0x01; 642 bus_speed += 0x01;
643 else if (mode == BUS_MODE_PCI) 643 else if (mode == BUS_MODE_PCI)
644 ; 644 ;
@@ -654,8 +654,8 @@ int ibmphp_update_slot_info(struct slot *slot_cur)
654 } 654 }
655 655
656 bus->cur_bus_speed = bus_speed; 656 bus->cur_bus_speed = bus_speed;
657 // To do: bus_names 657 // To do: bus_names
658 658
659 rc = pci_hp_change_slot_info(slot_cur->hotplug_slot, info); 659 rc = pci_hp_change_slot_info(slot_cur->hotplug_slot, info);
660 kfree(info); 660 kfree(info);
661 return rc; 661 return rc;
@@ -729,8 +729,8 @@ static void ibm_unconfigure_device(struct pci_func *func)
729} 729}
730 730
731/* 731/*
732 * The following function is to fix kernel bug regarding 732 * The following function is to fix kernel bug regarding
733 * getting bus entries, here we manually add those primary 733 * getting bus entries, here we manually add those primary
734 * bus entries to kernel bus structure whenever apply 734 * bus entries to kernel bus structure whenever apply
735 */ 735 */
736static u8 bus_structure_fixup(u8 busno) 736static u8 bus_structure_fixup(u8 busno)
@@ -814,7 +814,7 @@ static int ibm_configure_device(struct pci_func *func)
814} 814}
815 815
816/******************************************************* 816/*******************************************************
817 * Returns whether the bus is empty or not 817 * Returns whether the bus is empty or not
818 *******************************************************/ 818 *******************************************************/
819static int is_bus_empty(struct slot * slot_cur) 819static int is_bus_empty(struct slot * slot_cur)
820{ 820{
@@ -842,7 +842,7 @@ static int is_bus_empty(struct slot * slot_cur)
842} 842}
843 843
844/*********************************************************** 844/***********************************************************
845 * If the HPC permits and the bus currently empty, tries to set the 845 * If the HPC permits and the bus currently empty, tries to set the
846 * bus speed and mode at the maximum card and bus capability 846 * bus speed and mode at the maximum card and bus capability
847 * Parameters: slot 847 * Parameters: slot
848 * Returns: bus is set (0) or error code 848 * Returns: bus is set (0) or error code
@@ -856,7 +856,7 @@ static int set_bus(struct slot * slot_cur)
856 static struct pci_device_id ciobx[] = { 856 static struct pci_device_id ciobx[] = {
857 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 0x0101) }, 857 { PCI_DEVICE(PCI_VENDOR_ID_SERVERWORKS, 0x0101) },
858 { }, 858 { },
859 }; 859 };
860 860
861 debug("%s - entry slot # %d\n", __func__, slot_cur->number); 861 debug("%s - entry slot # %d\n", __func__, slot_cur->number);
862 if (SET_BUS_STATUS(slot_cur->ctrl) && is_bus_empty(slot_cur)) { 862 if (SET_BUS_STATUS(slot_cur->ctrl) && is_bus_empty(slot_cur)) {
@@ -877,7 +877,7 @@ static int set_bus(struct slot * slot_cur)
877 else if (!SLOT_BUS_MODE(slot_cur->ext_status)) 877 else if (!SLOT_BUS_MODE(slot_cur->ext_status))
878 /* if max slot/bus capability is 66 pci 878 /* if max slot/bus capability is 66 pci
879 and there's no bus mode mismatch, then 879 and there's no bus mode mismatch, then
880 the adapter supports 66 pci */ 880 the adapter supports 66 pci */
881 cmd = HPC_BUS_66CONVMODE; 881 cmd = HPC_BUS_66CONVMODE;
882 else 882 else
883 cmd = HPC_BUS_33CONVMODE; 883 cmd = HPC_BUS_33CONVMODE;
@@ -930,7 +930,7 @@ static int set_bus(struct slot * slot_cur)
930 return -EIO; 930 return -EIO;
931 } 931 }
932 } 932 }
933 /* This is for x440, once Brandon fixes the firmware, 933 /* This is for x440, once Brandon fixes the firmware,
934 will not need this delay */ 934 will not need this delay */
935 msleep(1000); 935 msleep(1000);
936 debug("%s -Exit\n", __func__); 936 debug("%s -Exit\n", __func__);
@@ -938,9 +938,9 @@ static int set_bus(struct slot * slot_cur)
938} 938}
939 939
940/* This routine checks the bus limitations that the slot is on from the BIOS. 940/* This routine checks the bus limitations that the slot is on from the BIOS.
941 * This is used in deciding whether or not to power up the slot. 941 * This is used in deciding whether or not to power up the slot.
942 * (electrical/spec limitations. For example, >1 133 MHz or >2 66 PCI cards on 942 * (electrical/spec limitations. For example, >1 133 MHz or >2 66 PCI cards on
943 * same bus) 943 * same bus)
944 * Parameters: slot 944 * Parameters: slot
945 * Returns: 0 = no limitations, -EINVAL = exceeded limitations on the bus 945 * Returns: 0 = no limitations, -EINVAL = exceeded limitations on the bus
946 */ 946 */
@@ -986,7 +986,7 @@ static int check_limitations(struct slot *slot_cur)
986static inline void print_card_capability(struct slot *slot_cur) 986static inline void print_card_capability(struct slot *slot_cur)
987{ 987{
988 info("capability of the card is "); 988 info("capability of the card is ");
989 if ((slot_cur->ext_status & CARD_INFO) == PCIX133) 989 if ((slot_cur->ext_status & CARD_INFO) == PCIX133)
990 info(" 133 MHz PCI-X\n"); 990 info(" 133 MHz PCI-X\n");
991 else if ((slot_cur->ext_status & CARD_INFO) == PCIX66) 991 else if ((slot_cur->ext_status & CARD_INFO) == PCIX66)
992 info(" 66 MHz PCI-X\n"); 992 info(" 66 MHz PCI-X\n");
@@ -1020,7 +1020,7 @@ static int enable_slot(struct hotplug_slot *hs)
1020 } 1020 }
1021 1021
1022 attn_LED_blink(slot_cur); 1022 attn_LED_blink(slot_cur);
1023 1023
1024 rc = set_bus(slot_cur); 1024 rc = set_bus(slot_cur);
1025 if (rc) { 1025 if (rc) {
1026 err("was not able to set the bus\n"); 1026 err("was not able to set the bus\n");
@@ -1082,7 +1082,7 @@ static int enable_slot(struct hotplug_slot *hs)
1082 rc = slot_update(&slot_cur); 1082 rc = slot_update(&slot_cur);
1083 if (rc) 1083 if (rc)
1084 goto error_power; 1084 goto error_power;
1085 1085
1086 rc = -EINVAL; 1086 rc = -EINVAL;
1087 if (SLOT_POWER(slot_cur->status) && !(SLOT_PWRGD(slot_cur->status))) { 1087 if (SLOT_POWER(slot_cur->status) && !(SLOT_PWRGD(slot_cur->status))) {
1088 err("power fault occurred trying to power up...\n"); 1088 err("power fault occurred trying to power up...\n");
@@ -1093,7 +1093,7 @@ static int enable_slot(struct hotplug_slot *hs)
1093 "speed and card capability\n"); 1093 "speed and card capability\n");
1094 print_card_capability(slot_cur); 1094 print_card_capability(slot_cur);
1095 goto error_power; 1095 goto error_power;
1096 } 1096 }
1097 /* Don't think this case will happen after above checks... 1097 /* Don't think this case will happen after above checks...
1098 * but just in case, for paranoia sake */ 1098 * but just in case, for paranoia sake */
1099 if (!(SLOT_POWER(slot_cur->status))) { 1099 if (!(SLOT_POWER(slot_cur->status))) {
@@ -1144,7 +1144,7 @@ static int enable_slot(struct hotplug_slot *hs)
1144 ibmphp_print_test(); 1144 ibmphp_print_test();
1145 rc = ibmphp_update_slot_info(slot_cur); 1145 rc = ibmphp_update_slot_info(slot_cur);
1146exit: 1146exit:
1147 ibmphp_unlock_operations(); 1147 ibmphp_unlock_operations();
1148 return rc; 1148 return rc;
1149 1149
1150error_nopower: 1150error_nopower:
@@ -1180,7 +1180,7 @@ static int ibmphp_disable_slot(struct hotplug_slot *hotplug_slot)
1180{ 1180{
1181 struct slot *slot = hotplug_slot->private; 1181 struct slot *slot = hotplug_slot->private;
1182 int rc; 1182 int rc;
1183 1183
1184 ibmphp_lock_operations(); 1184 ibmphp_lock_operations();
1185 rc = ibmphp_do_disable_slot(slot); 1185 rc = ibmphp_do_disable_slot(slot);
1186 ibmphp_unlock_operations(); 1186 ibmphp_unlock_operations();
@@ -1192,12 +1192,12 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
1192 int rc; 1192 int rc;
1193 u8 flag; 1193 u8 flag;
1194 1194
1195 debug("DISABLING SLOT...\n"); 1195 debug("DISABLING SLOT...\n");
1196 1196
1197 if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) { 1197 if ((slot_cur == NULL) || (slot_cur->ctrl == NULL)) {
1198 return -ENODEV; 1198 return -ENODEV;
1199 } 1199 }
1200 1200
1201 flag = slot_cur->flag; 1201 flag = slot_cur->flag;
1202 slot_cur->flag = 1; 1202 slot_cur->flag = 1;
1203 1203
@@ -1210,7 +1210,7 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
1210 attn_LED_blink(slot_cur); 1210 attn_LED_blink(slot_cur);
1211 1211
1212 if (slot_cur->func == NULL) { 1212 if (slot_cur->func == NULL) {
1213 /* We need this for fncs's that were there on bootup */ 1213 /* We need this for functions that were there on bootup */
1214 slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); 1214 slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL);
1215 if (!slot_cur->func) { 1215 if (!slot_cur->func) {
1216 err("out of system memory\n"); 1216 err("out of system memory\n");
@@ -1222,12 +1222,13 @@ int ibmphp_do_disable_slot(struct slot *slot_cur)
1222 } 1222 }
1223 1223
1224 ibm_unconfigure_device(slot_cur->func); 1224 ibm_unconfigure_device(slot_cur->func);
1225 1225
1226 /* If we got here from latch suddenly opening on operating card or 1226 /*
1227 a power fault, there's no power to the card, so cannot 1227 * If we got here from latch suddenly opening on operating card or
1228 read from it to determine what resources it occupied. This operation 1228 * a power fault, there's no power to the card, so cannot
1229 is forbidden anyhow. The best we can do is remove it from kernel 1229 * read from it to determine what resources it occupied. This operation
1230 lists at least */ 1230 * is forbidden anyhow. The best we can do is remove it from kernel
1231 * lists at least */
1231 1232
1232 if (!flag) { 1233 if (!flag) {
1233 attn_off(slot_cur); 1234 attn_off(slot_cur);
@@ -1264,7 +1265,7 @@ error:
1264 rc = -EFAULT; 1265 rc = -EFAULT;
1265 goto exit; 1266 goto exit;
1266 } 1267 }
1267 if (flag) 1268 if (flag)
1268 ibmphp_update_slot_info(slot_cur); 1269 ibmphp_update_slot_info(slot_cur);
1269 goto exit; 1270 goto exit;
1270} 1271}
@@ -1339,7 +1340,7 @@ static int __init ibmphp_init(void)
1339 debug("AFTER Resource & EBDA INITIALIZATIONS\n"); 1340 debug("AFTER Resource & EBDA INITIALIZATIONS\n");
1340 1341
1341 max_slots = get_max_slots(); 1342 max_slots = get_max_slots();
1342 1343
1343 if ((rc = ibmphp_register_pci())) 1344 if ((rc = ibmphp_register_pci()))
1344 goto error; 1345 goto error;
1345 1346
diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 9df78bc14541..bd044158b36c 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -123,7 +123,7 @@ static struct ebda_pci_rsrc *alloc_ebda_pci_rsrc (void)
123static void __init print_bus_info (void) 123static void __init print_bus_info (void)
124{ 124{
125 struct bus_info *ptr; 125 struct bus_info *ptr;
126 126
127 list_for_each_entry(ptr, &bus_info_head, bus_info_list) { 127 list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
128 debug ("%s - slot_min = %x\n", __func__, ptr->slot_min); 128 debug ("%s - slot_min = %x\n", __func__, ptr->slot_min);
129 debug ("%s - slot_max = %x\n", __func__, ptr->slot_max); 129 debug ("%s - slot_max = %x\n", __func__, ptr->slot_max);
@@ -131,7 +131,7 @@ static void __init print_bus_info (void)
131 debug ("%s - bus# = %x\n", __func__, ptr->busno); 131 debug ("%s - bus# = %x\n", __func__, ptr->busno);
132 debug ("%s - current_speed = %x\n", __func__, ptr->current_speed); 132 debug ("%s - current_speed = %x\n", __func__, ptr->current_speed);
133 debug ("%s - controller_id = %x\n", __func__, ptr->controller_id); 133 debug ("%s - controller_id = %x\n", __func__, ptr->controller_id);
134 134
135 debug ("%s - slots_at_33_conv = %x\n", __func__, ptr->slots_at_33_conv); 135 debug ("%s - slots_at_33_conv = %x\n", __func__, ptr->slots_at_33_conv);
136 debug ("%s - slots_at_66_conv = %x\n", __func__, ptr->slots_at_66_conv); 136 debug ("%s - slots_at_66_conv = %x\n", __func__, ptr->slots_at_66_conv);
137 debug ("%s - slots_at_66_pcix = %x\n", __func__, ptr->slots_at_66_pcix); 137 debug ("%s - slots_at_66_pcix = %x\n", __func__, ptr->slots_at_66_pcix);
@@ -144,7 +144,7 @@ static void __init print_bus_info (void)
144static void print_lo_info (void) 144static void print_lo_info (void)
145{ 145{
146 struct rio_detail *ptr; 146 struct rio_detail *ptr;
147 debug ("print_lo_info ----\n"); 147 debug ("print_lo_info ----\n");
148 list_for_each_entry(ptr, &rio_lo_head, rio_detail_list) { 148 list_for_each_entry(ptr, &rio_lo_head, rio_detail_list) {
149 debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id); 149 debug ("%s - rio_node_id = %x\n", __func__, ptr->rio_node_id);
150 debug ("%s - rio_type = %x\n", __func__, ptr->rio_type); 150 debug ("%s - rio_type = %x\n", __func__, ptr->rio_type);
@@ -176,7 +176,7 @@ static void __init print_ebda_pci_rsrc (void)
176 struct ebda_pci_rsrc *ptr; 176 struct ebda_pci_rsrc *ptr;
177 177
178 list_for_each_entry(ptr, &ibmphp_ebda_pci_rsrc_head, ebda_pci_rsrc_list) { 178 list_for_each_entry(ptr, &ibmphp_ebda_pci_rsrc_head, ebda_pci_rsrc_list) {
179 debug ("%s - rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n", 179 debug ("%s - rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
180 __func__, ptr->rsrc_type ,ptr->bus_num, ptr->dev_fun,ptr->start_addr, ptr->end_addr); 180 __func__, ptr->rsrc_type ,ptr->bus_num, ptr->dev_fun,ptr->start_addr, ptr->end_addr);
181 } 181 }
182} 182}
@@ -259,7 +259,7 @@ int __init ibmphp_access_ebda (void)
259 ebda_seg = readw (io_mem); 259 ebda_seg = readw (io_mem);
260 iounmap (io_mem); 260 iounmap (io_mem);
261 debug ("returned ebda segment: %x\n", ebda_seg); 261 debug ("returned ebda segment: %x\n", ebda_seg);
262 262
263 io_mem = ioremap(ebda_seg<<4, 1); 263 io_mem = ioremap(ebda_seg<<4, 1);
264 if (!io_mem) 264 if (!io_mem)
265 return -ENOMEM; 265 return -ENOMEM;
@@ -310,7 +310,7 @@ int __init ibmphp_access_ebda (void)
310 re = readw (io_mem + sub_addr); /* next sub blk */ 310 re = readw (io_mem + sub_addr); /* next sub blk */
311 311
312 sub_addr += 2; 312 sub_addr += 2;
313 rc_id = readw (io_mem + sub_addr); /* sub blk id */ 313 rc_id = readw (io_mem + sub_addr); /* sub blk id */
314 314
315 sub_addr += 2; 315 sub_addr += 2;
316 if (rc_id != 0x5243) 316 if (rc_id != 0x5243)
@@ -330,7 +330,7 @@ int __init ibmphp_access_ebda (void)
330 debug ("info about hpc descriptor---\n"); 330 debug ("info about hpc descriptor---\n");
331 debug ("hot blk format: %x\n", format); 331 debug ("hot blk format: %x\n", format);
332 debug ("num of controller: %x\n", num_ctlrs); 332 debug ("num of controller: %x\n", num_ctlrs);
333 debug ("offset of hpc data structure enteries: %x\n ", sub_addr); 333 debug ("offset of hpc data structure entries: %x\n ", sub_addr);
334 334
335 sub_addr = base + re; /* re sub blk */ 335 sub_addr = base + re; /* re sub blk */
336 /* FIXME: rc is never used/checked */ 336 /* FIXME: rc is never used/checked */
@@ -359,7 +359,7 @@ int __init ibmphp_access_ebda (void)
359 debug ("info about rsrc descriptor---\n"); 359 debug ("info about rsrc descriptor---\n");
360 debug ("format: %x\n", format); 360 debug ("format: %x\n", format);
361 debug ("num of rsrc: %x\n", num_entries); 361 debug ("num of rsrc: %x\n", num_entries);
362 debug ("offset of rsrc data structure enteries: %x\n ", sub_addr); 362 debug ("offset of rsrc data structure entries: %x\n ", sub_addr);
363 363
364 hs_complete = 1; 364 hs_complete = 1;
365 } else { 365 } else {
@@ -376,7 +376,7 @@ int __init ibmphp_access_ebda (void)
376 rio_table_ptr->scal_count = readb (io_mem + offset + 1); 376 rio_table_ptr->scal_count = readb (io_mem + offset + 1);
377 rio_table_ptr->riodev_count = readb (io_mem + offset + 2); 377 rio_table_ptr->riodev_count = readb (io_mem + offset + 2);
378 rio_table_ptr->offset = offset +3 ; 378 rio_table_ptr->offset = offset +3 ;
379 379
380 debug("info about rio table hdr ---\n"); 380 debug("info about rio table hdr ---\n");
381 debug("ver_num: %x\nscal_count: %x\nriodev_count: %x\noffset of rio table: %x\n ", 381 debug("ver_num: %x\nscal_count: %x\nriodev_count: %x\noffset of rio table: %x\n ",
382 rio_table_ptr->ver_num, rio_table_ptr->scal_count, 382 rio_table_ptr->ver_num, rio_table_ptr->scal_count,
@@ -440,12 +440,12 @@ static int __init ebda_rio_table (void)
440 rio_detail_ptr->chassis_num = readb (io_mem + offset + 14); 440 rio_detail_ptr->chassis_num = readb (io_mem + offset + 14);
441// debug ("rio_node_id: %x\nbbar: %x\nrio_type: %x\nowner_id: %x\nport0_node: %x\nport0_port: %x\nport1_node: %x\nport1_port: %x\nfirst_slot_num: %x\nstatus: %x\n", rio_detail_ptr->rio_node_id, rio_detail_ptr->bbar, rio_detail_ptr->rio_type, rio_detail_ptr->owner_id, rio_detail_ptr->port0_node_connect, rio_detail_ptr->port0_port_connect, rio_detail_ptr->port1_node_connect, rio_detail_ptr->port1_port_connect, rio_detail_ptr->first_slot_num, rio_detail_ptr->status); 441// debug ("rio_node_id: %x\nbbar: %x\nrio_type: %x\nowner_id: %x\nport0_node: %x\nport0_port: %x\nport1_node: %x\nport1_port: %x\nfirst_slot_num: %x\nstatus: %x\n", rio_detail_ptr->rio_node_id, rio_detail_ptr->bbar, rio_detail_ptr->rio_type, rio_detail_ptr->owner_id, rio_detail_ptr->port0_node_connect, rio_detail_ptr->port0_port_connect, rio_detail_ptr->port1_node_connect, rio_detail_ptr->port1_port_connect, rio_detail_ptr->first_slot_num, rio_detail_ptr->status);
442 //create linked list of chassis 442 //create linked list of chassis
443 if (rio_detail_ptr->rio_type == 4 || rio_detail_ptr->rio_type == 5) 443 if (rio_detail_ptr->rio_type == 4 || rio_detail_ptr->rio_type == 5)
444 list_add (&rio_detail_ptr->rio_detail_list, &rio_vg_head); 444 list_add (&rio_detail_ptr->rio_detail_list, &rio_vg_head);
445 //create linked list of expansion box 445 //create linked list of expansion box
446 else if (rio_detail_ptr->rio_type == 6 || rio_detail_ptr->rio_type == 7) 446 else if (rio_detail_ptr->rio_type == 6 || rio_detail_ptr->rio_type == 7)
447 list_add (&rio_detail_ptr->rio_detail_list, &rio_lo_head); 447 list_add (&rio_detail_ptr->rio_detail_list, &rio_lo_head);
448 else 448 else
449 // not in my concern 449 // not in my concern
450 kfree (rio_detail_ptr); 450 kfree (rio_detail_ptr);
451 offset += 15; 451 offset += 15;
@@ -456,7 +456,7 @@ static int __init ebda_rio_table (void)
456} 456}
457 457
458/* 458/*
459 * reorganizing linked list of chassis 459 * reorganizing linked list of chassis
460 */ 460 */
461static struct opt_rio *search_opt_vg (u8 chassis_num) 461static struct opt_rio *search_opt_vg (u8 chassis_num)
462{ 462{
@@ -464,7 +464,7 @@ static struct opt_rio *search_opt_vg (u8 chassis_num)
464 list_for_each_entry(ptr, &opt_vg_head, opt_rio_list) { 464 list_for_each_entry(ptr, &opt_vg_head, opt_rio_list) {
465 if (ptr->chassis_num == chassis_num) 465 if (ptr->chassis_num == chassis_num)
466 return ptr; 466 return ptr;
467 } 467 }
468 return NULL; 468 return NULL;
469} 469}
470 470
@@ -472,7 +472,7 @@ static int __init combine_wpg_for_chassis (void)
472{ 472{
473 struct opt_rio *opt_rio_ptr = NULL; 473 struct opt_rio *opt_rio_ptr = NULL;
474 struct rio_detail *rio_detail_ptr = NULL; 474 struct rio_detail *rio_detail_ptr = NULL;
475 475
476 list_for_each_entry(rio_detail_ptr, &rio_vg_head, rio_detail_list) { 476 list_for_each_entry(rio_detail_ptr, &rio_vg_head, rio_detail_list) {
477 opt_rio_ptr = search_opt_vg (rio_detail_ptr->chassis_num); 477 opt_rio_ptr = search_opt_vg (rio_detail_ptr->chassis_num);
478 if (!opt_rio_ptr) { 478 if (!opt_rio_ptr) {
@@ -484,14 +484,14 @@ static int __init combine_wpg_for_chassis (void)
484 opt_rio_ptr->first_slot_num = rio_detail_ptr->first_slot_num; 484 opt_rio_ptr->first_slot_num = rio_detail_ptr->first_slot_num;
485 opt_rio_ptr->middle_num = rio_detail_ptr->first_slot_num; 485 opt_rio_ptr->middle_num = rio_detail_ptr->first_slot_num;
486 list_add (&opt_rio_ptr->opt_rio_list, &opt_vg_head); 486 list_add (&opt_rio_ptr->opt_rio_list, &opt_vg_head);
487 } else { 487 } else {
488 opt_rio_ptr->first_slot_num = min (opt_rio_ptr->first_slot_num, rio_detail_ptr->first_slot_num); 488 opt_rio_ptr->first_slot_num = min (opt_rio_ptr->first_slot_num, rio_detail_ptr->first_slot_num);
489 opt_rio_ptr->middle_num = max (opt_rio_ptr->middle_num, rio_detail_ptr->first_slot_num); 489 opt_rio_ptr->middle_num = max (opt_rio_ptr->middle_num, rio_detail_ptr->first_slot_num);
490 } 490 }
491 } 491 }
492 print_opt_vg (); 492 print_opt_vg ();
493 return 0; 493 return 0;
494} 494}
495 495
496/* 496/*
497 * reorganizing linked list of expansion box 497 * reorganizing linked list of expansion box
@@ -502,7 +502,7 @@ static struct opt_rio_lo *search_opt_lo (u8 chassis_num)
502 list_for_each_entry(ptr, &opt_lo_head, opt_rio_lo_list) { 502 list_for_each_entry(ptr, &opt_lo_head, opt_rio_lo_list) {
503 if (ptr->chassis_num == chassis_num) 503 if (ptr->chassis_num == chassis_num)
504 return ptr; 504 return ptr;
505 } 505 }
506 return NULL; 506 return NULL;
507} 507}
508 508
@@ -510,7 +510,7 @@ static int combine_wpg_for_expansion (void)
510{ 510{
511 struct opt_rio_lo *opt_rio_lo_ptr = NULL; 511 struct opt_rio_lo *opt_rio_lo_ptr = NULL;
512 struct rio_detail *rio_detail_ptr = NULL; 512 struct rio_detail *rio_detail_ptr = NULL;
513 513
514 list_for_each_entry(rio_detail_ptr, &rio_lo_head, rio_detail_list) { 514 list_for_each_entry(rio_detail_ptr, &rio_lo_head, rio_detail_list) {
515 opt_rio_lo_ptr = search_opt_lo (rio_detail_ptr->chassis_num); 515 opt_rio_lo_ptr = search_opt_lo (rio_detail_ptr->chassis_num);
516 if (!opt_rio_lo_ptr) { 516 if (!opt_rio_lo_ptr) {
@@ -522,22 +522,22 @@ static int combine_wpg_for_expansion (void)
522 opt_rio_lo_ptr->first_slot_num = rio_detail_ptr->first_slot_num; 522 opt_rio_lo_ptr->first_slot_num = rio_detail_ptr->first_slot_num;
523 opt_rio_lo_ptr->middle_num = rio_detail_ptr->first_slot_num; 523 opt_rio_lo_ptr->middle_num = rio_detail_ptr->first_slot_num;
524 opt_rio_lo_ptr->pack_count = 1; 524 opt_rio_lo_ptr->pack_count = 1;
525 525
526 list_add (&opt_rio_lo_ptr->opt_rio_lo_list, &opt_lo_head); 526 list_add (&opt_rio_lo_ptr->opt_rio_lo_list, &opt_lo_head);
527 } else { 527 } else {
528 opt_rio_lo_ptr->first_slot_num = min (opt_rio_lo_ptr->first_slot_num, rio_detail_ptr->first_slot_num); 528 opt_rio_lo_ptr->first_slot_num = min (opt_rio_lo_ptr->first_slot_num, rio_detail_ptr->first_slot_num);
529 opt_rio_lo_ptr->middle_num = max (opt_rio_lo_ptr->middle_num, rio_detail_ptr->first_slot_num); 529 opt_rio_lo_ptr->middle_num = max (opt_rio_lo_ptr->middle_num, rio_detail_ptr->first_slot_num);
530 opt_rio_lo_ptr->pack_count = 2; 530 opt_rio_lo_ptr->pack_count = 2;
531 } 531 }
532 } 532 }
533 return 0; 533 return 0;
534} 534}
535 535
536 536
537/* Since we don't know the max slot number per each chassis, hence go 537/* Since we don't know the max slot number per each chassis, hence go
538 * through the list of all chassis to find out the range 538 * through the list of all chassis to find out the range
539 * Arguments: slot_num, 1st slot number of the chassis we think we are on, 539 * Arguments: slot_num, 1st slot number of the chassis we think we are on,
540 * var (0 = chassis, 1 = expansion box) 540 * var (0 = chassis, 1 = expansion box)
541 */ 541 */
542static int first_slot_num (u8 slot_num, u8 first_slot, u8 var) 542static int first_slot_num (u8 slot_num, u8 first_slot, u8 var)
543{ 543{
@@ -547,7 +547,7 @@ static int first_slot_num (u8 slot_num, u8 first_slot, u8 var)
547 547
548 if (!var) { 548 if (!var) {
549 list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) { 549 list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) {
550 if ((first_slot < opt_vg_ptr->first_slot_num) && (slot_num >= opt_vg_ptr->first_slot_num)) { 550 if ((first_slot < opt_vg_ptr->first_slot_num) && (slot_num >= opt_vg_ptr->first_slot_num)) {
551 rc = -ENODEV; 551 rc = -ENODEV;
552 break; 552 break;
553 } 553 }
@@ -569,7 +569,7 @@ static struct opt_rio_lo * find_rxe_num (u8 slot_num)
569 569
570 list_for_each_entry(opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) { 570 list_for_each_entry(opt_lo_ptr, &opt_lo_head, opt_rio_lo_list) {
571 //check to see if this slot_num belongs to expansion box 571 //check to see if this slot_num belongs to expansion box
572 if ((slot_num >= opt_lo_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_lo_ptr->first_slot_num, 1))) 572 if ((slot_num >= opt_lo_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_lo_ptr->first_slot_num, 1)))
573 return opt_lo_ptr; 573 return opt_lo_ptr;
574 } 574 }
575 return NULL; 575 return NULL;
@@ -580,8 +580,8 @@ static struct opt_rio * find_chassis_num (u8 slot_num)
580 struct opt_rio *opt_vg_ptr; 580 struct opt_rio *opt_vg_ptr;
581 581
582 list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) { 582 list_for_each_entry(opt_vg_ptr, &opt_vg_head, opt_rio_list) {
583 //check to see if this slot_num belongs to chassis 583 //check to see if this slot_num belongs to chassis
584 if ((slot_num >= opt_vg_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_vg_ptr->first_slot_num, 0))) 584 if ((slot_num >= opt_vg_ptr->first_slot_num) && (!first_slot_num (slot_num, opt_vg_ptr->first_slot_num, 0)))
585 return opt_vg_ptr; 585 return opt_vg_ptr;
586 } 586 }
587 return NULL; 587 return NULL;
@@ -594,13 +594,13 @@ static u8 calculate_first_slot (u8 slot_num)
594{ 594{
595 u8 first_slot = 1; 595 u8 first_slot = 1;
596 struct slot * slot_cur; 596 struct slot * slot_cur;
597 597
598 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) { 598 list_for_each_entry(slot_cur, &ibmphp_slot_head, ibm_slot_list) {
599 if (slot_cur->ctrl) { 599 if (slot_cur->ctrl) {
600 if ((slot_cur->ctrl->ctlr_type != 4) && (slot_cur->ctrl->ending_slot_num > first_slot) && (slot_num > slot_cur->ctrl->ending_slot_num)) 600 if ((slot_cur->ctrl->ctlr_type != 4) && (slot_cur->ctrl->ending_slot_num > first_slot) && (slot_num > slot_cur->ctrl->ending_slot_num))
601 first_slot = slot_cur->ctrl->ending_slot_num; 601 first_slot = slot_cur->ctrl->ending_slot_num;
602 } 602 }
603 } 603 }
604 return first_slot + 1; 604 return first_slot + 1;
605 605
606} 606}
@@ -622,11 +622,11 @@ static char *create_file_name (struct slot * slot_cur)
622 err ("Structure passed is empty\n"); 622 err ("Structure passed is empty\n");
623 return NULL; 623 return NULL;
624 } 624 }
625 625
626 slot_num = slot_cur->number; 626 slot_num = slot_cur->number;
627 627
628 memset (str, 0, sizeof(str)); 628 memset (str, 0, sizeof(str));
629 629
630 if (rio_table_ptr) { 630 if (rio_table_ptr) {
631 if (rio_table_ptr->ver_num == 3) { 631 if (rio_table_ptr->ver_num == 3) {
632 opt_vg_ptr = find_chassis_num (slot_num); 632 opt_vg_ptr = find_chassis_num (slot_num);
@@ -660,7 +660,7 @@ static char *create_file_name (struct slot * slot_cur)
660 /* if both NULL and we DO have correct RIO table in BIOS */ 660 /* if both NULL and we DO have correct RIO table in BIOS */
661 return NULL; 661 return NULL;
662 } 662 }
663 } 663 }
664 if (!flag) { 664 if (!flag) {
665 if (slot_cur->ctrl->ctlr_type == 4) { 665 if (slot_cur->ctrl->ctlr_type == 4) {
666 first_slot = calculate_first_slot (slot_num); 666 first_slot = calculate_first_slot (slot_num);
@@ -798,7 +798,7 @@ static int __init ebda_rsrc_controller (void)
798 slot_ptr->ctl_index = readb (io_mem + addr_slot + 2*slot_num); 798 slot_ptr->ctl_index = readb (io_mem + addr_slot + 2*slot_num);
799 slot_ptr->slot_cap = readb (io_mem + addr_slot + 3*slot_num); 799 slot_ptr->slot_cap = readb (io_mem + addr_slot + 3*slot_num);
800 800
801 // create bus_info lined list --- if only one slot per bus: slot_min = slot_max 801 // create bus_info lined list --- if only one slot per bus: slot_min = slot_max
802 802
803 bus_info_ptr2 = ibmphp_find_same_bus_num (slot_ptr->slot_bus_num); 803 bus_info_ptr2 = ibmphp_find_same_bus_num (slot_ptr->slot_bus_num);
804 if (!bus_info_ptr2) { 804 if (!bus_info_ptr2) {
@@ -814,9 +814,9 @@ static int __init ebda_rsrc_controller (void)
814 bus_info_ptr1->index = bus_index++; 814 bus_info_ptr1->index = bus_index++;
815 bus_info_ptr1->current_speed = 0xff; 815 bus_info_ptr1->current_speed = 0xff;
816 bus_info_ptr1->current_bus_mode = 0xff; 816 bus_info_ptr1->current_bus_mode = 0xff;
817 817
818 bus_info_ptr1->controller_id = hpc_ptr->ctlr_id; 818 bus_info_ptr1->controller_id = hpc_ptr->ctlr_id;
819 819
820 list_add_tail (&bus_info_ptr1->bus_info_list, &bus_info_head); 820 list_add_tail (&bus_info_ptr1->bus_info_list, &bus_info_head);
821 821
822 } else { 822 } else {
@@ -851,7 +851,7 @@ static int __init ebda_rsrc_controller (void)
851 bus_info_ptr2->slots_at_66_conv = bus_ptr->slots_at_66_conv; 851 bus_info_ptr2->slots_at_66_conv = bus_ptr->slots_at_66_conv;
852 bus_info_ptr2->slots_at_66_pcix = bus_ptr->slots_at_66_pcix; 852 bus_info_ptr2->slots_at_66_pcix = bus_ptr->slots_at_66_pcix;
853 bus_info_ptr2->slots_at_100_pcix = bus_ptr->slots_at_100_pcix; 853 bus_info_ptr2->slots_at_100_pcix = bus_ptr->slots_at_100_pcix;
854 bus_info_ptr2->slots_at_133_pcix = bus_ptr->slots_at_133_pcix; 854 bus_info_ptr2->slots_at_133_pcix = bus_ptr->slots_at_133_pcix;
855 } 855 }
856 bus_ptr++; 856 bus_ptr++;
857 } 857 }
@@ -864,7 +864,7 @@ static int __init ebda_rsrc_controller (void)
864 hpc_ptr->u.pci_ctlr.dev_fun = readb (io_mem + addr + 1); 864 hpc_ptr->u.pci_ctlr.dev_fun = readb (io_mem + addr + 1);
865 hpc_ptr->irq = readb (io_mem + addr + 2); 865 hpc_ptr->irq = readb (io_mem + addr + 2);
866 addr += 3; 866 addr += 3;
867 debug ("ctrl bus = %x, ctlr devfun = %x, irq = %x\n", 867 debug ("ctrl bus = %x, ctlr devfun = %x, irq = %x\n",
868 hpc_ptr->u.pci_ctlr.bus, 868 hpc_ptr->u.pci_ctlr.bus,
869 hpc_ptr->u.pci_ctlr.dev_fun, hpc_ptr->irq); 869 hpc_ptr->u.pci_ctlr.dev_fun, hpc_ptr->irq);
870 break; 870 break;
@@ -932,7 +932,7 @@ static int __init ebda_rsrc_controller (void)
932 tmp_slot->supported_speed = 2; 932 tmp_slot->supported_speed = 2;
933 else if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_66_MAX) == EBDA_SLOT_66_MAX) 933 else if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_66_MAX) == EBDA_SLOT_66_MAX)
934 tmp_slot->supported_speed = 1; 934 tmp_slot->supported_speed = 1;
935 935
936 if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_PCIX_CAP) == EBDA_SLOT_PCIX_CAP) 936 if ((hpc_ptr->slots[index].slot_cap & EBDA_SLOT_PCIX_CAP) == EBDA_SLOT_PCIX_CAP)
937 tmp_slot->supported_bus_mode = 1; 937 tmp_slot->supported_bus_mode = 1;
938 else 938 else
@@ -1000,7 +1000,7 @@ error_no_hpc:
1000 return rc; 1000 return rc;
1001} 1001}
1002 1002
1003/* 1003/*
1004 * map info (bus, devfun, start addr, end addr..) of i/o, memory, 1004 * map info (bus, devfun, start addr, end addr..) of i/o, memory,
1005 * pfm from the physical addr to a list of resource. 1005 * pfm from the physical addr to a list of resource.
1006 */ 1006 */
@@ -1057,7 +1057,7 @@ static int __init ebda_rsrc_rsrc (void)
1057 addr += 10; 1057 addr += 10;
1058 1058
1059 debug ("rsrc from mem or pfm ---\n"); 1059 debug ("rsrc from mem or pfm ---\n");
1060 debug ("rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n", 1060 debug ("rsrc type: %x bus#: %x dev_func: %x start addr: %x end addr: %x\n",
1061 rsrc_ptr->rsrc_type, rsrc_ptr->bus_num, rsrc_ptr->dev_fun, rsrc_ptr->start_addr, rsrc_ptr->end_addr); 1061 rsrc_ptr->rsrc_type, rsrc_ptr->bus_num, rsrc_ptr->dev_fun, rsrc_ptr->start_addr, rsrc_ptr->end_addr);
1062 1062
1063 list_add (&rsrc_ptr->ebda_pci_rsrc_list, &ibmphp_ebda_pci_rsrc_head); 1063 list_add (&rsrc_ptr->ebda_pci_rsrc_list, &ibmphp_ebda_pci_rsrc_head);
@@ -1096,7 +1096,7 @@ struct bus_info *ibmphp_find_same_bus_num (u32 num)
1096 struct bus_info *ptr; 1096 struct bus_info *ptr;
1097 1097
1098 list_for_each_entry(ptr, &bus_info_head, bus_info_list) { 1098 list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
1099 if (ptr->busno == num) 1099 if (ptr->busno == num)
1100 return ptr; 1100 return ptr;
1101 } 1101 }
1102 return NULL; 1102 return NULL;
@@ -1110,7 +1110,7 @@ int ibmphp_get_bus_index (u8 num)
1110 struct bus_info *ptr; 1110 struct bus_info *ptr;
1111 1111
1112 list_for_each_entry(ptr, &bus_info_head, bus_info_list) { 1112 list_for_each_entry(ptr, &bus_info_head, bus_info_list) {
1113 if (ptr->busno == num) 1113 if (ptr->busno == num)
1114 return ptr->index; 1114 return ptr->index;
1115 } 1115 }
1116 return -ENODEV; 1116 return -ENODEV;
@@ -1168,7 +1168,7 @@ static struct pci_device_id id_table[] = {
1168 .subdevice = HPC_SUBSYSTEM_ID, 1168 .subdevice = HPC_SUBSYSTEM_ID,
1169 .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00), 1169 .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00),
1170 }, {} 1170 }, {}
1171}; 1171};
1172 1172
1173MODULE_DEVICE_TABLE(pci, id_table); 1173MODULE_DEVICE_TABLE(pci, id_table);
1174 1174
@@ -1197,7 +1197,7 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
1197 struct controller *ctrl; 1197 struct controller *ctrl;
1198 1198
1199 debug ("inside ibmphp_probe\n"); 1199 debug ("inside ibmphp_probe\n");
1200 1200
1201 list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) { 1201 list_for_each_entry(ctrl, &ebda_hpc_head, ebda_hpc_list) {
1202 if (ctrl->ctlr_type == 1) { 1202 if (ctrl->ctlr_type == 1) {
1203 if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) { 1203 if ((dev->devfn == ctrl->u.pci_ctlr.dev_fun) && (dev->bus->number == ctrl->u.pci_ctlr.bus)) {
@@ -1210,4 +1210,3 @@ static int ibmphp_probe (struct pci_dev * dev, const struct pci_device_id *ids)
1210 } 1210 }
1211 return -ENODEV; 1211 return -ENODEV;
1212} 1212}
1213
diff --git a/drivers/pci/hotplug/ibmphp_hpc.c b/drivers/pci/hotplug/ibmphp_hpc.c
index f59ed30512b5..5fc7a089f532 100644
--- a/drivers/pci/hotplug/ibmphp_hpc.c
+++ b/drivers/pci/hotplug/ibmphp_hpc.c
@@ -258,7 +258,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8
258{ 258{
259 u8 rc; 259 u8 rc;
260 void __iomem *wpg_addr; // base addr + offset 260 void __iomem *wpg_addr; // base addr + offset
261 unsigned long wpg_data; // data to/from WPG LOHI format 261 unsigned long wpg_data; // data to/from WPG LOHI format
262 unsigned long ultemp; 262 unsigned long ultemp;
263 unsigned long data; // actual data HILO format 263 unsigned long data; // actual data HILO format
264 int i; 264 int i;
@@ -351,7 +351,7 @@ static u8 i2c_ctrl_write (struct controller *ctlr_ptr, void __iomem *WPGBbar, u8
351} 351}
352 352
353//------------------------------------------------------------ 353//------------------------------------------------------------
354// Read from ISA type HPC 354// Read from ISA type HPC
355//------------------------------------------------------------ 355//------------------------------------------------------------
356static u8 isa_ctrl_read (struct controller *ctlr_ptr, u8 offset) 356static u8 isa_ctrl_read (struct controller *ctlr_ptr, u8 offset)
357{ 357{
@@ -372,7 +372,7 @@ static void isa_ctrl_write (struct controller *ctlr_ptr, u8 offset, u8 data)
372{ 372{
373 u16 start_address; 373 u16 start_address;
374 u16 port_address; 374 u16 port_address;
375 375
376 start_address = ctlr_ptr->u.isa_ctlr.io_start; 376 start_address = ctlr_ptr->u.isa_ctlr.io_start;
377 port_address = start_address + (u16) offset; 377 port_address = start_address + (u16) offset;
378 outb (data, port_address); 378 outb (data, port_address);
@@ -656,11 +656,11 @@ int ibmphp_hpc_readslot (struct slot * pslot, u8 cmd, u8 * pstatus)
656 //-------------------------------------------------------------------- 656 //--------------------------------------------------------------------
657 // cleanup 657 // cleanup
658 //-------------------------------------------------------------------- 658 //--------------------------------------------------------------------
659 659
660 // remove physical to logical address mapping 660 // remove physical to logical address mapping
661 if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4)) 661 if ((ctlr_ptr->ctlr_type == 2) || (ctlr_ptr->ctlr_type == 4))
662 iounmap (wpg_bbar); 662 iounmap (wpg_bbar);
663 663
664 free_hpc_access (); 664 free_hpc_access ();
665 665
666 debug_polling ("%s - Exit rc[%d]\n", __func__, rc); 666 debug_polling ("%s - Exit rc[%d]\n", __func__, rc);
@@ -835,7 +835,7 @@ static int poll_hpc(void *data)
835 down (&semOperations); 835 down (&semOperations);
836 836
837 switch (poll_state) { 837 switch (poll_state) {
838 case POLL_LATCH_REGISTER: 838 case POLL_LATCH_REGISTER:
839 oldlatchlow = curlatchlow; 839 oldlatchlow = curlatchlow;
840 ctrl_count = 0x00; 840 ctrl_count = 0x00;
841 list_for_each (pslotlist, &ibmphp_slot_head) { 841 list_for_each (pslotlist, &ibmphp_slot_head) {
@@ -892,16 +892,16 @@ static int poll_hpc(void *data)
892 892
893 if (kthread_should_stop()) 893 if (kthread_should_stop())
894 goto out_sleep; 894 goto out_sleep;
895 895
896 down (&semOperations); 896 down (&semOperations);
897 897
898 if (poll_count >= POLL_LATCH_CNT) { 898 if (poll_count >= POLL_LATCH_CNT) {
899 poll_count = 0; 899 poll_count = 0;
900 poll_state = POLL_SLOTS; 900 poll_state = POLL_SLOTS;
901 } else 901 } else
902 poll_state = POLL_LATCH_REGISTER; 902 poll_state = POLL_LATCH_REGISTER;
903 break; 903 break;
904 } 904 }
905 /* give up the hardware semaphore */ 905 /* give up the hardware semaphore */
906 up (&semOperations); 906 up (&semOperations);
907 /* sleep for a short time just for good measure */ 907 /* sleep for a short time just for good measure */
@@ -958,7 +958,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
958 // bit 5 - HPC_SLOT_PWRGD 958 // bit 5 - HPC_SLOT_PWRGD
959 if ((pslot->status & 0x20) != (poldslot->status & 0x20)) 959 if ((pslot->status & 0x20) != (poldslot->status & 0x20))
960 // OFF -> ON: ignore, ON -> OFF: disable slot 960 // OFF -> ON: ignore, ON -> OFF: disable slot
961 if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) 961 if ((poldslot->status & 0x20) && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status)))
962 disable = 1; 962 disable = 1;
963 963
964 // bit 6 - HPC_SLOT_BUS_SPEED 964 // bit 6 - HPC_SLOT_BUS_SPEED
@@ -980,7 +980,7 @@ static int process_changeinstatus (struct slot *pslot, struct slot *poldslot)
980 pslot->status &= ~HPC_SLOT_POWER; 980 pslot->status &= ~HPC_SLOT_POWER;
981 } 981 }
982 } 982 }
983 // CLOSE -> OPEN 983 // CLOSE -> OPEN
984 else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD) 984 else if ((SLOT_PWRGD (poldslot->status) == HPC_SLOT_PWRGD_GOOD)
985 && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) { 985 && (SLOT_CONNECT (poldslot->status) == HPC_SLOT_CONNECTED) && (SLOT_PRESENT (poldslot->status))) {
986 disable = 1; 986 disable = 1;
@@ -1075,7 +1075,7 @@ void __exit ibmphp_hpc_stop_poll_thread (void)
1075 debug ("before locking operations \n"); 1075 debug ("before locking operations \n");
1076 ibmphp_lock_operations (); 1076 ibmphp_lock_operations ();
1077 debug ("after locking operations \n"); 1077 debug ("after locking operations \n");
1078 1078
1079 // wait for poll thread to exit 1079 // wait for poll thread to exit
1080 debug ("before sem_exit down \n"); 1080 debug ("before sem_exit down \n");
1081 down (&sem_exit); 1081 down (&sem_exit);
diff --git a/drivers/pci/hotplug/ibmphp_pci.c b/drivers/pci/hotplug/ibmphp_pci.c
index c60f5f3e838d..639ea3a75e14 100644
--- a/drivers/pci/hotplug/ibmphp_pci.c
+++ b/drivers/pci/hotplug/ibmphp_pci.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * IBM Hot Plug Controller Driver 2 * IBM Hot Plug Controller Driver
3 * 3 *
4 * Written By: Irene Zubarev, IBM Corporation 4 * Written By: Irene Zubarev, IBM Corporation
5 * 5 *
6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) 6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
7 * Copyright (C) 2001,2002 IBM Corp. 7 * Copyright (C) 2001,2002 IBM Corp.
8 * 8 *
@@ -42,7 +42,7 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno);
42 42
43/* 43/*
44 * NOTE..... If BIOS doesn't provide default routing, we assign: 44 * NOTE..... If BIOS doesn't provide default routing, we assign:
45 * 9 for SCSI, 10 for LAN adapters, and 11 for everything else. 45 * 9 for SCSI, 10 for LAN adapters, and 11 for everything else.
46 * If adapter is bridged, then we assign 11 to it and devices behind it. 46 * If adapter is bridged, then we assign 11 to it and devices behind it.
47 * We also assign the same irq numbers for multi function devices. 47 * We also assign the same irq numbers for multi function devices.
48 * These are PIC mode, so shouldn't matter n.e.ways (hopefully) 48 * These are PIC mode, so shouldn't matter n.e.ways (hopefully)
@@ -71,11 +71,11 @@ static void assign_alt_irq (struct pci_func * cur_func, u8 class_code)
71 * Configures the device to be added (will allocate needed resources if it 71 * Configures the device to be added (will allocate needed resources if it
72 * can), the device can be a bridge or a regular pci device, can also be 72 * can), the device can be a bridge or a regular pci device, can also be
73 * multi-functional 73 * multi-functional
74 * 74 *
75 * Input: function to be added 75 * Input: function to be added
76 * 76 *
77 * TO DO: The error case with Multifunction device or multi function bridge, 77 * TO DO: The error case with Multifunction device or multi function bridge,
78 * if there is an error, will need to go through all previous functions and 78 * if there is an error, will need to go through all previous functions and
79 * unconfigure....or can add some code into unconfigure_card.... 79 * unconfigure....or can add some code into unconfigure_card....
80 */ 80 */
81int ibmphp_configure_card (struct pci_func *func, u8 slotno) 81int ibmphp_configure_card (struct pci_func *func, u8 slotno)
@@ -98,7 +98,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
98 cur_func = func; 98 cur_func = func;
99 99
100 /* We only get bus and device from IRQ routing table. So at this point, 100 /* We only get bus and device from IRQ routing table. So at this point,
101 * func->busno is correct, and func->device contains only device (at the 5 101 * func->busno is correct, and func->device contains only device (at the 5
102 * highest bits) 102 * highest bits)
103 */ 103 */
104 104
@@ -151,7 +151,7 @@ int ibmphp_configure_card (struct pci_func *func, u8 slotno)
151 cur_func->device, cur_func->busno); 151 cur_func->device, cur_func->busno);
152 cleanup_count = 6; 152 cleanup_count = 6;
153 goto error; 153 goto error;
154 } 154 }
155 cur_func->next = NULL; 155 cur_func->next = NULL;
156 function = 0x8; 156 function = 0x8;
157 break; 157 break;
@@ -339,7 +339,7 @@ error:
339} 339}
340 340
341/* 341/*
342 * This function configures the pci BARs of a single device. 342 * This function configures the pci BARs of a single device.
343 * Input: pointer to the pci_func 343 * Input: pointer to the pci_func
344 * Output: configured PCI, 0, or error 344 * Output: configured PCI, 0, or error
345 */ 345 */
@@ -371,17 +371,17 @@ static int configure_device (struct pci_func *func)
371 371
372 for (count = 0; address[count]; count++) { /* for 6 BARs */ 372 for (count = 0; address[count]; count++) { /* for 6 BARs */
373 373
374 /* not sure if i need this. per scott, said maybe need smth like this 374 /* not sure if i need this. per scott, said maybe need * something like this
375 if devices don't adhere 100% to the spec, so don't want to write 375 if devices don't adhere 100% to the spec, so don't want to write
376 to the reserved bits 376 to the reserved bits
377 377
378 pcibios_read_config_byte(cur_func->busno, cur_func->device, 378 pcibios_read_config_byte(cur_func->busno, cur_func->device,
379 PCI_BASE_ADDRESS_0 + 4 * count, &tmp); 379 PCI_BASE_ADDRESS_0 + 4 * count, &tmp);
380 if (tmp & 0x01) // IO 380 if (tmp & 0x01) // IO
381 pcibios_write_config_dword(cur_func->busno, cur_func->device, 381 pcibios_write_config_dword(cur_func->busno, cur_func->device,
382 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFD); 382 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFD);
383 else // Memory 383 else // Memory
384 pcibios_write_config_dword(cur_func->busno, cur_func->device, 384 pcibios_write_config_dword(cur_func->busno, cur_func->device,
385 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFF); 385 PCI_BASE_ADDRESS_0 + 4 * count, 0xFFFFFFFF);
386 */ 386 */
387 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF); 387 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], 0xFFFFFFFF);
@@ -421,8 +421,8 @@ static int configure_device (struct pci_func *func)
421 return -EIO; 421 return -EIO;
422 } 422 }
423 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->io[count]->start); 423 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->io[count]->start);
424 424
425 /* _______________This is for debugging purposes only_____________________ */ 425 /* _______________This is for debugging purposes only_____________________ */
426 debug ("b4 writing, the IO address is %x\n", func->io[count]->start); 426 debug ("b4 writing, the IO address is %x\n", func->io[count]->start);
427 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]); 427 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
428 debug ("after writing.... the start address is %x\n", bar[count]); 428 debug ("after writing.... the start address is %x\n", bar[count]);
@@ -484,7 +484,7 @@ static int configure_device (struct pci_func *func)
484 484
485 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->pfmem[count]->start); 485 pci_bus_write_config_dword (ibmphp_pci_bus, devfn, address[count], func->pfmem[count]->start);
486 486
487 /*_______________This is for debugging purposes only______________________________*/ 487 /*_______________This is for debugging purposes only______________________________*/
488 debug ("b4 writing, start address is %x\n", func->pfmem[count]->start); 488 debug ("b4 writing, start address is %x\n", func->pfmem[count]->start);
489 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]); 489 pci_bus_read_config_dword (ibmphp_pci_bus, devfn, address[count], &bar[count]);
490 debug ("after writing, start address is %x\n", bar[count]); 490 debug ("after writing, start address is %x\n", bar[count]);
@@ -559,7 +559,7 @@ static int configure_device (struct pci_func *func)
559/****************************************************************************** 559/******************************************************************************
560 * This routine configures a PCI-2-PCI bridge and the functions behind it 560 * This routine configures a PCI-2-PCI bridge and the functions behind it
561 * Parameters: pci_func 561 * Parameters: pci_func
562 * Returns: 562 * Returns:
563 ******************************************************************************/ 563 ******************************************************************************/
564static int configure_bridge (struct pci_func **func_passed, u8 slotno) 564static int configure_bridge (struct pci_func **func_passed, u8 slotno)
565{ 565{
@@ -622,7 +622,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
622 debug ("AFTER FIND_SEC_NUMBER, func->busno IS %x\n", func->busno); 622 debug ("AFTER FIND_SEC_NUMBER, func->busno IS %x\n", func->busno);
623 623
624 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, sec_number); 624 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, sec_number);
625 625
626 /* __________________For debugging purposes only __________________________________ 626 /* __________________For debugging purposes only __________________________________
627 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number); 627 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_number);
628 debug ("sec_number after write/read is %x\n", sec_number); 628 debug ("sec_number after write/read is %x\n", sec_number);
@@ -644,7 +644,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
644 644
645 645
646 /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 646 /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
647 !!!!!!!!!!!!!!!NEED TO ADD!!! FAST BACK-TO-BACK ENABLE!!!!!!!!!!!!!!!!!!!! 647 !!!!!!!!!!!!!!!NEED TO ADD!!! FAST BACK-TO-BACK ENABLE!!!!!!!!!!!!!!!!!!!!
648 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/ 648 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
649 649
650 650
@@ -670,7 +670,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
670 debug ("len[count] in IO = %x\n", len[count]); 670 debug ("len[count] in IO = %x\n", len[count]);
671 671
672 bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL); 672 bus_io[count] = kzalloc(sizeof(struct resource_node), GFP_KERNEL);
673 673
674 if (!bus_io[count]) { 674 if (!bus_io[count]) {
675 err ("out of system memory\n"); 675 err ("out of system memory\n");
676 retval = -ENOMEM; 676 retval = -ENOMEM;
@@ -735,7 +735,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
735 ibmphp_add_pfmem_from_mem (bus_pfmem[count]); 735 ibmphp_add_pfmem_from_mem (bus_pfmem[count]);
736 func->pfmem[count] = bus_pfmem[count]; 736 func->pfmem[count] = bus_pfmem[count];
737 } else { 737 } else {
738 err ("cannot allocate requested pfmem for bus %x, device %x, len %x\n", 738 err ("cannot allocate requested pfmem for bus %x, device %x, len %x\n",
739 func->busno, func->device, len[count]); 739 func->busno, func->device, len[count]);
740 kfree (mem_tmp); 740 kfree (mem_tmp);
741 kfree (bus_pfmem[count]); 741 kfree (bus_pfmem[count]);
@@ -805,7 +805,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
805 debug ("amount_needed->mem = %x\n", amount_needed->mem); 805 debug ("amount_needed->mem = %x\n", amount_needed->mem);
806 debug ("amount_needed->pfmem = %x\n", amount_needed->pfmem); 806 debug ("amount_needed->pfmem = %x\n", amount_needed->pfmem);
807 807
808 if (amount_needed->not_correct) { 808 if (amount_needed->not_correct) {
809 debug ("amount_needed is not correct\n"); 809 debug ("amount_needed is not correct\n");
810 for (count = 0; address[count]; count++) { 810 for (count = 0; address[count]; count++) {
811 /* for 2 BARs */ 811 /* for 2 BARs */
@@ -830,7 +830,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
830 } else { 830 } else {
831 debug ("it wants %x IO behind the bridge\n", amount_needed->io); 831 debug ("it wants %x IO behind the bridge\n", amount_needed->io);
832 io = kzalloc(sizeof(*io), GFP_KERNEL); 832 io = kzalloc(sizeof(*io), GFP_KERNEL);
833 833
834 if (!io) { 834 if (!io) {
835 err ("out of system memory\n"); 835 err ("out of system memory\n");
836 retval = -ENOMEM; 836 retval = -ENOMEM;
@@ -959,7 +959,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
959 959
960 if (bus->noIORanges) { 960 if (bus->noIORanges) {
961 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_IO_BASE, 0x00 | bus->rangeIO->start >> 8); 961 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_IO_BASE, 0x00 | bus->rangeIO->start >> 8);
962 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_IO_LIMIT, 0x00 | bus->rangeIO->end >> 8); 962 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_IO_LIMIT, 0x00 | bus->rangeIO->end >> 8);
963 963
964 /* _______________This is for debugging purposes only ____________________ 964 /* _______________This is for debugging purposes only ____________________
965 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_IO_BASE, &temp); 965 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_IO_BASE, &temp);
@@ -980,7 +980,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
980 if (bus->noMemRanges) { 980 if (bus->noMemRanges) {
981 pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, 0x0000 | bus->rangeMem->start >> 16); 981 pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, 0x0000 | bus->rangeMem->start >> 16);
982 pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_LIMIT, 0x0000 | bus->rangeMem->end >> 16); 982 pci_bus_write_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_LIMIT, 0x0000 | bus->rangeMem->end >> 16);
983 983
984 /* ____________________This is for debugging purposes only ________________________ 984 /* ____________________This is for debugging purposes only ________________________
985 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, &temp); 985 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, &temp);
986 debug ("mem_base = %x\n", (temp & PCI_MEMORY_RANGE_TYPE_MASK) << 16); 986 debug ("mem_base = %x\n", (temp & PCI_MEMORY_RANGE_TYPE_MASK) << 16);
@@ -1017,7 +1017,7 @@ static int configure_bridge (struct pci_func **func_passed, u8 slotno)
1017 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_INTERRUPT_PIN, &irq); 1017 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_INTERRUPT_PIN, &irq);
1018 if ((irq > 0x00) && (irq < 0x05)) 1018 if ((irq > 0x00) && (irq < 0x05))
1019 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_INTERRUPT_LINE, func->irq[irq - 1]); 1019 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_INTERRUPT_LINE, func->irq[irq - 1]);
1020 /* 1020 /*
1021 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, ctrl); 1021 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, ctrl);
1022 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_PARITY); 1022 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_PARITY);
1023 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_SERR); 1023 pci_bus_write_config_byte (ibmphp_pci_bus, devfn, PCI_BRIDGE_CONTROL, PCI_BRIDGE_CTL_SERR);
@@ -1071,7 +1071,7 @@ error:
1071 * This function adds up the amount of resources needed behind the PPB bridge 1071 * This function adds up the amount of resources needed behind the PPB bridge
1072 * and passes it to the configure_bridge function 1072 * and passes it to the configure_bridge function
1073 * Input: bridge function 1073 * Input: bridge function
1074 * Ouput: amount of resources needed 1074 * Output: amount of resources needed
1075 *****************************************************************************/ 1075 *****************************************************************************/
1076static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno) 1076static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
1077{ 1077{
@@ -1204,9 +1204,9 @@ static struct res_needed *scan_behind_bridge (struct pci_func * func, u8 busno)
1204 return amount; 1204 return amount;
1205} 1205}
1206 1206
1207/* The following 3 unconfigure_boot_ routines deal with the case when we had the card 1207/* The following 3 unconfigure_boot_ routines deal with the case when we had the card
1208 * upon bootup in the system, since we don't allocate func to such case, we need to read 1208 * upon bootup in the system, since we don't allocate func to such case, we need to read
1209 * the start addresses from pci config space and then find the corresponding entries in 1209 * the start addresses from pci config space and then find the corresponding entries in
1210 * our resource lists. The functions return either 0, -ENODEV, or -1 (general failure) 1210 * our resource lists. The functions return either 0, -ENODEV, or -1 (general failure)
1211 * Change: we also call these functions even if we configured the card ourselves (i.e., not 1211 * Change: we also call these functions even if we configured the card ourselves (i.e., not
1212 * the bootup case), since it should work same way 1212 * the bootup case), since it should work same way
@@ -1561,8 +1561,8 @@ static int unconfigure_boot_card (struct slot *slot_cur)
1561 * unconfiguring the device 1561 * unconfiguring the device
1562 * TO DO: will probably need to add some code in case there was some resource, 1562 * TO DO: will probably need to add some code in case there was some resource,
1563 * to remove it... this is from when we have errors in the configure_card... 1563 * to remove it... this is from when we have errors in the configure_card...
1564 * !!!!!!!!!!!!!!!!!!!!!!!!!FOR BUSES!!!!!!!!!!!! 1564 * !!!!!!!!!!!!!!!!!!!!!!!!!FOR BUSES!!!!!!!!!!!!
1565 * Returns: 0, -1, -ENODEV 1565 * Returns: 0, -1, -ENODEV
1566 */ 1566 */
1567int ibmphp_unconfigure_card (struct slot **slot_cur, int the_end) 1567int ibmphp_unconfigure_card (struct slot **slot_cur, int the_end)
1568{ 1568{
@@ -1634,7 +1634,7 @@ int ibmphp_unconfigure_card (struct slot **slot_cur, int the_end)
1634 * Input: bus and the amount of resources needed (we know we can assign those, 1634 * Input: bus and the amount of resources needed (we know we can assign those,
1635 * since they've been checked already 1635 * since they've been checked already
1636 * Output: bus added to the correct spot 1636 * Output: bus added to the correct spot
1637 * 0, -1, error 1637 * 0, -1, error
1638 */ 1638 */
1639static int add_new_bus (struct bus_node *bus, struct resource_node *io, struct resource_node *mem, struct resource_node *pfmem, u8 parent_busno) 1639static int add_new_bus (struct bus_node *bus, struct resource_node *io, struct resource_node *mem, struct resource_node *pfmem, u8 parent_busno)
1640{ 1640{
@@ -1650,7 +1650,7 @@ static int add_new_bus (struct bus_node *bus, struct resource_node *io, struct r
1650 err ("strange, cannot find bus which is supposed to be at the system... something is terribly wrong...\n"); 1650 err ("strange, cannot find bus which is supposed to be at the system... something is terribly wrong...\n");
1651 return -ENODEV; 1651 return -ENODEV;
1652 } 1652 }
1653 1653
1654 list_add (&bus->bus_list, &cur_bus->bus_list); 1654 list_add (&bus->bus_list, &cur_bus->bus_list);
1655 } 1655 }
1656 if (io) { 1656 if (io) {
@@ -1679,7 +1679,7 @@ static int add_new_bus (struct bus_node *bus, struct resource_node *io, struct r
1679 } 1679 }
1680 if (pfmem) { 1680 if (pfmem) {
1681 pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL); 1681 pfmem_range = kzalloc(sizeof(*pfmem_range), GFP_KERNEL);
1682 if (!pfmem_range) { 1682 if (!pfmem_range) {
1683 err ("out of system memory\n"); 1683 err ("out of system memory\n");
1684 return -ENOMEM; 1684 return -ENOMEM;
1685 } 1685 }
@@ -1726,4 +1726,3 @@ static u8 find_sec_number (u8 primary_busno, u8 slotno)
1726 return busno; 1726 return busno;
1727 return 0xff; 1727 return 0xff;
1728} 1728}
1729
diff --git a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c
index e2dc289f767c..a265acb2d518 100644
--- a/drivers/pci/hotplug/ibmphp_res.c
+++ b/drivers/pci/hotplug/ibmphp_res.c
@@ -72,7 +72,7 @@ static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8
72static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr) 72static struct resource_node * __init alloc_resources (struct ebda_pci_rsrc * curr)
73{ 73{
74 struct resource_node *rs; 74 struct resource_node *rs;
75 75
76 if (!curr) { 76 if (!curr) {
77 err ("NULL passed to allocate\n"); 77 err ("NULL passed to allocate\n");
78 return NULL; 78 return NULL;
@@ -128,7 +128,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
128 } 128 }
129 newrange->start = curr->start_addr; 129 newrange->start = curr->start_addr;
130 newrange->end = curr->end_addr; 130 newrange->end = curr->end_addr;
131 131
132 if (first_bus || (!num_ranges)) 132 if (first_bus || (!num_ranges))
133 newrange->rangeno = 1; 133 newrange->rangeno = 1;
134 else { 134 else {
@@ -162,7 +162,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
162 newbus->rangePFMem = newrange; 162 newbus->rangePFMem = newrange;
163 if (first_bus) 163 if (first_bus)
164 newbus->noPFMemRanges = 1; 164 newbus->noPFMemRanges = 1;
165 else { 165 else {
166 debug ("1st PFMemory Primary on Bus %x [%x - %x]\n", newbus->busno, newrange->start, newrange->end); 166 debug ("1st PFMemory Primary on Bus %x [%x - %x]\n", newbus->busno, newrange->start, newrange->end);
167 ++newbus->noPFMemRanges; 167 ++newbus->noPFMemRanges;
168 fix_resources (newbus); 168 fix_resources (newbus);
@@ -190,7 +190,7 @@ static int __init alloc_bus_range (struct bus_node **new_bus, struct range_node
190 * This is the Resource Management initialization function. It will go through 190 * This is the Resource Management initialization function. It will go through
191 * the Resource list taken from EBDA and fill in this module's data structures 191 * the Resource list taken from EBDA and fill in this module's data structures
192 * 192 *
193 * THIS IS NOT TAKING INTO CONSIDERATION IO RESTRICTIONS OF PRIMARY BUSES, 193 * THIS IS NOT TAKING INTO CONSIDERATION IO RESTRICTIONS OF PRIMARY BUSES,
194 * SINCE WE'RE GOING TO ASSUME FOR NOW WE DON'T HAVE THOSE ON OUR BUSES FOR NOW 194 * SINCE WE'RE GOING TO ASSUME FOR NOW WE DON'T HAVE THOSE ON OUR BUSES FOR NOW
195 * 195 *
196 * Input: ptr to the head of the resource list from EBDA 196 * Input: ptr to the head of the resource list from EBDA
@@ -382,7 +382,7 @@ int __init ibmphp_rsrc_init (void)
382 * pci devices' resources for the appropriate resource 382 * pci devices' resources for the appropriate resource
383 * 383 *
384 * Input: type of the resource, range to add, current bus 384 * Input: type of the resource, range to add, current bus
385 * Output: 0 or -1, bus and range ptrs 385 * Output: 0 or -1, bus and range ptrs
386 ********************************************************************************/ 386 ********************************************************************************/
387static int add_bus_range (int type, struct range_node *range, struct bus_node *bus_cur) 387static int add_bus_range (int type, struct range_node *range, struct bus_node *bus_cur)
388{ 388{
@@ -466,7 +466,7 @@ static void update_resources (struct bus_node *bus_cur, int type, int rangeno)
466 466
467 switch (type) { 467 switch (type) {
468 case MEM: 468 case MEM:
469 if (bus_cur->firstMem) 469 if (bus_cur->firstMem)
470 res = bus_cur->firstMem; 470 res = bus_cur->firstMem;
471 break; 471 break;
472 case PFMEM: 472 case PFMEM:
@@ -583,7 +583,7 @@ static void fix_resources (struct bus_node *bus_cur)
583} 583}
584 584
585/******************************************************************************* 585/*******************************************************************************
586 * This routine adds a resource to the list of resources to the appropriate bus 586 * This routine adds a resource to the list of resources to the appropriate bus
587 * based on their resource type and sorted by their starting addresses. It assigns 587 * based on their resource type and sorted by their starting addresses. It assigns
588 * the ptrs to next and nextRange if needed. 588 * the ptrs to next and nextRange if needed.
589 * 589 *
@@ -605,11 +605,11 @@ int ibmphp_add_resource (struct resource_node *res)
605 err ("NULL passed to add\n"); 605 err ("NULL passed to add\n");
606 return -ENODEV; 606 return -ENODEV;
607 } 607 }
608 608
609 bus_cur = find_bus_wprev (res->busno, NULL, 0); 609 bus_cur = find_bus_wprev (res->busno, NULL, 0);
610 610
611 if (!bus_cur) { 611 if (!bus_cur) {
612 /* didn't find a bus, smth's wrong!!! */ 612 /* didn't find a bus, something's wrong!!! */
613 debug ("no bus in the system, either pci_dev's wrong or allocation failed\n"); 613 debug ("no bus in the system, either pci_dev's wrong or allocation failed\n");
614 return -ENODEV; 614 return -ENODEV;
615 } 615 }
@@ -648,7 +648,7 @@ int ibmphp_add_resource (struct resource_node *res)
648 if (!range_cur) { 648 if (!range_cur) {
649 switch (res->type) { 649 switch (res->type) {
650 case IO: 650 case IO:
651 ++bus_cur->needIOUpdate; 651 ++bus_cur->needIOUpdate;
652 break; 652 break;
653 case MEM: 653 case MEM:
654 ++bus_cur->needMemUpdate; 654 ++bus_cur->needMemUpdate;
@@ -659,13 +659,13 @@ int ibmphp_add_resource (struct resource_node *res)
659 } 659 }
660 res->rangeno = -1; 660 res->rangeno = -1;
661 } 661 }
662 662
663 debug ("The range is %d\n", res->rangeno); 663 debug ("The range is %d\n", res->rangeno);
664 if (!res_start) { 664 if (!res_start) {
665 /* no first{IO,Mem,Pfmem} on the bus, 1st IO/Mem/Pfmem resource ever */ 665 /* no first{IO,Mem,Pfmem} on the bus, 1st IO/Mem/Pfmem resource ever */
666 switch (res->type) { 666 switch (res->type) {
667 case IO: 667 case IO:
668 bus_cur->firstIO = res; 668 bus_cur->firstIO = res;
669 break; 669 break;
670 case MEM: 670 case MEM:
671 bus_cur->firstMem = res; 671 bus_cur->firstMem = res;
@@ -673,7 +673,7 @@ int ibmphp_add_resource (struct resource_node *res)
673 case PFMEM: 673 case PFMEM:
674 bus_cur->firstPFMem = res; 674 bus_cur->firstPFMem = res;
675 break; 675 break;
676 } 676 }
677 res->next = NULL; 677 res->next = NULL;
678 res->nextRange = NULL; 678 res->nextRange = NULL;
679 } else { 679 } else {
@@ -770,7 +770,7 @@ int ibmphp_add_resource (struct resource_node *res)
770 * This routine will remove the resource from the list of resources 770 * This routine will remove the resource from the list of resources
771 * 771 *
772 * Input: io, mem, and/or pfmem resource to be deleted 772 * Input: io, mem, and/or pfmem resource to be deleted
773 * Ouput: modified resource list 773 * Output: modified resource list
774 * 0 or error code 774 * 0 or error code
775 ****************************************************************************/ 775 ****************************************************************************/
776int ibmphp_remove_resource (struct resource_node *res) 776int ibmphp_remove_resource (struct resource_node *res)
@@ -825,7 +825,7 @@ int ibmphp_remove_resource (struct resource_node *res)
825 825
826 if (!res_cur) { 826 if (!res_cur) {
827 if (res->type == PFMEM) { 827 if (res->type == PFMEM) {
828 /* 828 /*
829 * case where pfmem might be in the PFMemFromMem list 829 * case where pfmem might be in the PFMemFromMem list
830 * so will also need to remove the corresponding mem 830 * so will also need to remove the corresponding mem
831 * entry 831 * entry
@@ -961,12 +961,12 @@ static struct range_node * find_range (struct bus_node *bus_cur, struct resource
961} 961}
962 962
963/***************************************************************************** 963/*****************************************************************************
964 * This routine will check to make sure the io/mem/pfmem->len that the device asked for 964 * This routine will check to make sure the io/mem/pfmem->len that the device asked for
965 * can fit w/i our list of available IO/MEM/PFMEM resources. If cannot, returns -EINVAL, 965 * can fit w/i our list of available IO/MEM/PFMEM resources. If cannot, returns -EINVAL,
966 * otherwise, returns 0 966 * otherwise, returns 0
967 * 967 *
968 * Input: resource 968 * Input: resource
969 * Ouput: the correct start and end address are inputted into the resource node, 969 * Output: the correct start and end address are inputted into the resource node,
970 * 0 or -EINVAL 970 * 0 or -EINVAL
971 *****************************************************************************/ 971 *****************************************************************************/
972int ibmphp_check_resource (struct resource_node *res, u8 bridge) 972int ibmphp_check_resource (struct resource_node *res, u8 bridge)
@@ -996,7 +996,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
996 bus_cur = find_bus_wprev (res->busno, NULL, 0); 996 bus_cur = find_bus_wprev (res->busno, NULL, 0);
997 997
998 if (!bus_cur) { 998 if (!bus_cur) {
999 /* didn't find a bus, smth's wrong!!! */ 999 /* didn't find a bus, something's wrong!!! */
1000 debug ("no bus in the system, either pci_dev's wrong or allocation failed\n"); 1000 debug ("no bus in the system, either pci_dev's wrong or allocation failed\n");
1001 return -EINVAL; 1001 return -EINVAL;
1002 } 1002 }
@@ -1066,7 +1066,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1066 break; 1066 break;
1067 } 1067 }
1068 } 1068 }
1069 1069
1070 if (flag && len_cur == res->len) { 1070 if (flag && len_cur == res->len) {
1071 debug ("but we are not here, right?\n"); 1071 debug ("but we are not here, right?\n");
1072 res->start = start_cur; 1072 res->start = start_cur;
@@ -1118,10 +1118,10 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1118 if (res_prev) { 1118 if (res_prev) {
1119 if (res_prev->rangeno != res_cur->rangeno) { 1119 if (res_prev->rangeno != res_cur->rangeno) {
1120 /* 1st device on this range */ 1120 /* 1st device on this range */
1121 if ((res_cur->start != range->start) && 1121 if ((res_cur->start != range->start) &&
1122 ((len_tmp = res_cur->start - 1 - range->start) >= res->len)) { 1122 ((len_tmp = res_cur->start - 1 - range->start) >= res->len)) {
1123 if ((len_tmp < len_cur) || (len_cur == 0)) { 1123 if ((len_tmp < len_cur) || (len_cur == 0)) {
1124 if ((range->start % tmp_divide) == 0) { 1124 if ((range->start % tmp_divide) == 0) {
1125 /* just perfect, starting address is divisible by length */ 1125 /* just perfect, starting address is divisible by length */
1126 flag = 1; 1126 flag = 1;
1127 len_cur = len_tmp; 1127 len_cur = len_tmp;
@@ -1344,7 +1344,7 @@ int ibmphp_check_resource (struct resource_node *res, u8 bridge)
1344 * This routine is called from remove_card if the card contained PPB. 1344 * This routine is called from remove_card if the card contained PPB.
1345 * It will remove all the resources on the bus as well as the bus itself 1345 * It will remove all the resources on the bus as well as the bus itself
1346 * Input: Bus 1346 * Input: Bus
1347 * Ouput: 0, -ENODEV 1347 * Output: 0, -ENODEV
1348 ********************************************************************************/ 1348 ********************************************************************************/
1349int ibmphp_remove_bus (struct bus_node *bus, u8 parent_busno) 1349int ibmphp_remove_bus (struct bus_node *bus, u8 parent_busno)
1350{ 1350{
@@ -1353,7 +1353,7 @@ int ibmphp_remove_bus (struct bus_node *bus, u8 parent_busno)
1353 struct bus_node *prev_bus; 1353 struct bus_node *prev_bus;
1354 int rc; 1354 int rc;
1355 1355
1356 prev_bus = find_bus_wprev (parent_busno, NULL, 0); 1356 prev_bus = find_bus_wprev (parent_busno, NULL, 0);
1357 1357
1358 if (!prev_bus) { 1358 if (!prev_bus) {
1359 debug ("something terribly wrong. Cannot find parent bus to the one to remove\n"); 1359 debug ("something terribly wrong. Cannot find parent bus to the one to remove\n");
@@ -1424,7 +1424,7 @@ int ibmphp_remove_bus (struct bus_node *bus, u8 parent_busno)
1424} 1424}
1425 1425
1426/****************************************************************************** 1426/******************************************************************************
1427 * This routine deletes the ranges from a given bus, and the entries from the 1427 * This routine deletes the ranges from a given bus, and the entries from the
1428 * parent's bus in the resources 1428 * parent's bus in the resources
1429 * Input: current bus, previous bus 1429 * Input: current bus, previous bus
1430 * Output: 0, -EINVAL 1430 * Output: 0, -EINVAL
@@ -1453,7 +1453,7 @@ static int remove_ranges (struct bus_node *bus_cur, struct bus_node *bus_prev)
1453 if (bus_cur->noMemRanges) { 1453 if (bus_cur->noMemRanges) {
1454 range_cur = bus_cur->rangeMem; 1454 range_cur = bus_cur->rangeMem;
1455 for (i = 0; i < bus_cur->noMemRanges; i++) { 1455 for (i = 0; i < bus_cur->noMemRanges; i++) {
1456 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, MEM) < 0) 1456 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, MEM) < 0)
1457 return -EINVAL; 1457 return -EINVAL;
1458 1458
1459 ibmphp_remove_resource (res); 1459 ibmphp_remove_resource (res);
@@ -1467,7 +1467,7 @@ static int remove_ranges (struct bus_node *bus_cur, struct bus_node *bus_prev)
1467 if (bus_cur->noPFMemRanges) { 1467 if (bus_cur->noPFMemRanges) {
1468 range_cur = bus_cur->rangePFMem; 1468 range_cur = bus_cur->rangePFMem;
1469 for (i = 0; i < bus_cur->noPFMemRanges; i++) { 1469 for (i = 0; i < bus_cur->noPFMemRanges; i++) {
1470 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, PFMEM) < 0) 1470 if (ibmphp_find_resource (bus_prev, range_cur->start, &res, PFMEM) < 0)
1471 return -EINVAL; 1471 return -EINVAL;
1472 1472
1473 ibmphp_remove_resource (res); 1473 ibmphp_remove_resource (res);
@@ -1482,7 +1482,7 @@ static int remove_ranges (struct bus_node *bus_cur, struct bus_node *bus_prev)
1482} 1482}
1483 1483
1484/* 1484/*
1485 * find the resource node in the bus 1485 * find the resource node in the bus
1486 * Input: Resource needed, start address of the resource, type of resource 1486 * Input: Resource needed, start address of the resource, type of resource
1487 */ 1487 */
1488int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resource_node **res, int flag) 1488int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resource_node **res, int flag)
@@ -1512,7 +1512,7 @@ int ibmphp_find_resource (struct bus_node *bus, u32 start_address, struct resour
1512 err ("wrong type of flag\n"); 1512 err ("wrong type of flag\n");
1513 return -EINVAL; 1513 return -EINVAL;
1514 } 1514 }
1515 1515
1516 while (res_cur) { 1516 while (res_cur) {
1517 if (res_cur->start == start_address) { 1517 if (res_cur->start == start_address) {
1518 *res = res_cur; 1518 *res = res_cur;
@@ -1718,7 +1718,7 @@ static int __init once_over (void)
1718 } /* end for pfmem */ 1718 } /* end for pfmem */
1719 } /* end if */ 1719 } /* end if */
1720 } /* end list_for_each bus */ 1720 } /* end list_for_each bus */
1721 return 0; 1721 return 0;
1722} 1722}
1723 1723
1724int ibmphp_add_pfmem_from_mem (struct resource_node *pfmem) 1724int ibmphp_add_pfmem_from_mem (struct resource_node *pfmem)
@@ -1760,9 +1760,9 @@ static struct bus_node *find_bus_wprev (u8 bus_number, struct bus_node **prev, u
1760 list_for_each (tmp, &gbuses) { 1760 list_for_each (tmp, &gbuses) {
1761 tmp_prev = tmp->prev; 1761 tmp_prev = tmp->prev;
1762 bus_cur = list_entry (tmp, struct bus_node, bus_list); 1762 bus_cur = list_entry (tmp, struct bus_node, bus_list);
1763 if (flag) 1763 if (flag)
1764 *prev = list_entry (tmp_prev, struct bus_node, bus_list); 1764 *prev = list_entry (tmp_prev, struct bus_node, bus_list);
1765 if (bus_cur->busno == bus_number) 1765 if (bus_cur->busno == bus_number)
1766 return bus_cur; 1766 return bus_cur;
1767 } 1767 }
1768 1768
@@ -1776,7 +1776,7 @@ void ibmphp_print_test (void)
1776 struct range_node *range; 1776 struct range_node *range;
1777 struct resource_node *res; 1777 struct resource_node *res;
1778 struct list_head *tmp; 1778 struct list_head *tmp;
1779 1779
1780 debug_pci ("*****************START**********************\n"); 1780 debug_pci ("*****************START**********************\n");
1781 1781
1782 if ((!list_empty(&gbuses)) && flags) { 1782 if ((!list_empty(&gbuses)) && flags) {
@@ -1906,7 +1906,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu
1906 return 1; 1906 return 1;
1907 range_cur = range_cur->next; 1907 range_cur = range_cur->next;
1908 } 1908 }
1909 1909
1910 return 0; 1910 return 0;
1911} 1911}
1912 1912
@@ -1920,7 +1920,7 @@ static int range_exists_already (struct range_node * range, struct bus_node * bu
1920 * Returns: none 1920 * Returns: none
1921 * Note: this function doesn't take into account IO restrictions etc, 1921 * Note: this function doesn't take into account IO restrictions etc,
1922 * so will only work for bridges with no video/ISA devices behind them It 1922 * so will only work for bridges with no video/ISA devices behind them It
1923 * also will not work for onboard PPB's that can have more than 1 *bus 1923 * also will not work for onboard PPBs that can have more than 1 *bus
1924 * behind them All these are TO DO. 1924 * behind them All these are TO DO.
1925 * Also need to add more error checkings... (from fnc returns etc) 1925 * Also need to add more error checkings... (from fnc returns etc)
1926 */ 1926 */
@@ -1963,7 +1963,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
1963 case PCI_HEADER_TYPE_BRIDGE: 1963 case PCI_HEADER_TYPE_BRIDGE:
1964 function = 0x8; 1964 function = 0x8;
1965 case PCI_HEADER_TYPE_MULTIBRIDGE: 1965 case PCI_HEADER_TYPE_MULTIBRIDGE:
1966 /* We assume here that only 1 bus behind the bridge 1966 /* We assume here that only 1 bus behind the bridge
1967 TO DO: add functionality for several: 1967 TO DO: add functionality for several:
1968 temp = secondary; 1968 temp = secondary;
1969 while (temp < subordinate) { 1969 while (temp < subordinate) {
@@ -1972,7 +1972,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
1972 } 1972 }
1973 */ 1973 */
1974 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_busno); 1974 pci_bus_read_config_byte (ibmphp_pci_bus, devfn, PCI_SECONDARY_BUS, &sec_busno);
1975 bus_sec = find_bus_wprev (sec_busno, NULL, 0); 1975 bus_sec = find_bus_wprev (sec_busno, NULL, 0);
1976 /* this bus structure doesn't exist yet, PPB was configured during previous loading of ibmphp */ 1976 /* this bus structure doesn't exist yet, PPB was configured during previous loading of ibmphp */
1977 if (!bus_sec) { 1977 if (!bus_sec) {
1978 bus_sec = alloc_error_bus (NULL, sec_busno, 1); 1978 bus_sec = alloc_error_bus (NULL, sec_busno, 1);
@@ -2028,7 +2028,7 @@ static int __init update_bridge_ranges (struct bus_node **bus)
2028 io->len = io->end - io->start + 1; 2028 io->len = io->end - io->start + 1;
2029 ibmphp_add_resource (io); 2029 ibmphp_add_resource (io);
2030 } 2030 }
2031 } 2031 }
2032 2032
2033 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, &start_mem_address); 2033 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_BASE, &start_mem_address);
2034 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_LIMIT, &end_mem_address); 2034 pci_bus_read_config_word (ibmphp_pci_bus, devfn, PCI_MEMORY_LIMIT, &end_mem_address);
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c
index ec20f74c8981..cfa92a984e62 100644
--- a/drivers/pci/hotplug/pci_hotplug_core.c
+++ b/drivers/pci/hotplug/pci_hotplug_core.c
@@ -131,7 +131,7 @@ static ssize_t power_write_file(struct pci_slot *pci_slot, const char *buf,
131 } 131 }
132 module_put(slot->ops->owner); 132 module_put(slot->ops->owner);
133 133
134exit: 134exit:
135 if (retval) 135 if (retval)
136 return retval; 136 return retval;
137 return count; 137 return count;
@@ -177,7 +177,7 @@ static ssize_t attention_write_file(struct pci_slot *slot, const char *buf,
177 retval = ops->set_attention_status(slot->hotplug, attention); 177 retval = ops->set_attention_status(slot->hotplug, attention);
178 module_put(ops->owner); 178 module_put(ops->owner);
179 179
180exit: 180exit:
181 if (retval) 181 if (retval)
182 return retval; 182 return retval;
183 return count; 183 return count;
@@ -247,7 +247,7 @@ static ssize_t test_write_file(struct pci_slot *pci_slot, const char *buf,
247 retval = slot->ops->hardware_test(slot, test); 247 retval = slot->ops->hardware_test(slot, test);
248 module_put(slot->ops->owner); 248 module_put(slot->ops->owner);
249 249
250exit: 250exit:
251 if (retval) 251 if (retval)
252 return retval; 252 return retval;
253 return count; 253 return count;
@@ -512,7 +512,7 @@ int pci_hp_deregister(struct hotplug_slot *hotplug)
512 * @hotplug: pointer to the slot whose info has changed 512 * @hotplug: pointer to the slot whose info has changed
513 * @info: pointer to the info copy into the slot's info structure 513 * @info: pointer to the info copy into the slot's info structure
514 * 514 *
515 * @slot must have been registered with the pci 515 * @slot must have been registered with the pci
516 * hotplug subsystem previously with a call to pci_hp_register(). 516 * hotplug subsystem previously with a call to pci_hp_register().
517 * 517 *
518 * Returns 0 if successful, anything else for an error. 518 * Returns 0 if successful, anything else for an error.
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h
index 541bbe6d5343..21e865ded1dc 100644
--- a/drivers/pci/hotplug/pciehp.h
+++ b/drivers/pci/hotplug/pciehp.h
@@ -180,5 +180,5 @@ static inline int pciehp_acpi_slot_detection_check(struct pci_dev *dev)
180{ 180{
181 return 0; 181 return 0;
182} 182}
183#endif /* CONFIG_ACPI */ 183#endif /* CONFIG_ACPI */
184#endif /* _PCIEHP_H */ 184#endif /* _PCIEHP_H */
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c
index ead7c534095e..55ea2a07f266 100644
--- a/drivers/pci/hotplug/pciehp_acpi.c
+++ b/drivers/pci/hotplug/pciehp_acpi.c
@@ -78,7 +78,7 @@ static int __initdata dup_slot_id;
78static int __initdata acpi_slot_detected; 78static int __initdata acpi_slot_detected;
79static struct list_head __initdata dummy_slots = LIST_HEAD_INIT(dummy_slots); 79static struct list_head __initdata dummy_slots = LIST_HEAD_INIT(dummy_slots);
80 80
81/* Dummy driver for dumplicate name detection */ 81/* Dummy driver for duplicate name detection */
82static int __init dummy_probe(struct pcie_device *dev) 82static int __init dummy_probe(struct pcie_device *dev)
83{ 83{
84 u32 slot_cap; 84 u32 slot_cap;
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c
index f4a18f51a29c..bbd48bbe4e9b 100644
--- a/drivers/pci/hotplug/pciehp_core.c
+++ b/drivers/pci/hotplug/pciehp_core.c
@@ -351,8 +351,8 @@ static int __init pcied_init(void)
351 351
352 pciehp_firmware_init(); 352 pciehp_firmware_init();
353 retval = pcie_port_service_register(&hpdriver_portdrv); 353 retval = pcie_port_service_register(&hpdriver_portdrv);
354 dbg("pcie_port_service_register = %d\n", retval); 354 dbg("pcie_port_service_register = %d\n", retval);
355 info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); 355 info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
356 if (retval) 356 if (retval)
357 dbg("Failure to register service\n"); 357 dbg("Failure to register service\n");
358 358
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 51f56ef4ab6f..3eea3fdd4b0b 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -92,7 +92,7 @@ static void start_int_poll_timer(struct controller *ctrl, int sec)
92{ 92{
93 /* Clamp to sane value */ 93 /* Clamp to sane value */
94 if ((sec <= 0) || (sec > 60)) 94 if ((sec <= 0) || (sec > 60))
95 sec = 2; 95 sec = 2;
96 96
97 ctrl->poll_timer.function = &int_poll_timeout; 97 ctrl->poll_timer.function = &int_poll_timeout;
98 ctrl->poll_timer.data = (unsigned long)ctrl; 98 ctrl->poll_timer.data = (unsigned long)ctrl;
@@ -194,7 +194,7 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
194 ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n"); 194 ctrl_dbg(ctrl, "CMD_COMPLETED not clear after 1 sec\n");
195 } else if (!NO_CMD_CMPL(ctrl)) { 195 } else if (!NO_CMD_CMPL(ctrl)) {
196 /* 196 /*
197 * This controller semms to notify of command completed 197 * This controller seems to notify of command completed
198 * event even though it supports none of power 198 * event even though it supports none of power
199 * controller, attention led, power led and EMI. 199 * controller, attention led, power led and EMI.
200 */ 200 */
@@ -926,7 +926,7 @@ struct controller *pcie_init(struct pcie_device *dev)
926 if (pciehp_writew(ctrl, PCI_EXP_SLTSTA, 0x1f)) 926 if (pciehp_writew(ctrl, PCI_EXP_SLTSTA, 0x1f))
927 goto abort_ctrl; 927 goto abort_ctrl;
928 928
929 /* Disable sotfware notification */ 929 /* Disable software notification */
930 pcie_disable_notification(ctrl); 930 pcie_disable_notification(ctrl);
931 931
932 ctrl_info(ctrl, "HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", 932 ctrl_info(ctrl, "HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n",
diff --git a/drivers/pci/hotplug/pcihp_skeleton.c b/drivers/pci/hotplug/pcihp_skeleton.c
index 1f00b937f721..ac69094e4b20 100644
--- a/drivers/pci/hotplug/pcihp_skeleton.c
+++ b/drivers/pci/hotplug/pcihp_skeleton.c
@@ -52,7 +52,7 @@ static LIST_HEAD(slot_list);
52 do { \ 52 do { \
53 if (debug) \ 53 if (debug) \
54 printk (KERN_DEBUG "%s: " format "\n", \ 54 printk (KERN_DEBUG "%s: " format "\n", \
55 MY_NAME , ## arg); \ 55 MY_NAME , ## arg); \
56 } while (0) 56 } while (0)
57#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg) 57#define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME , ## arg)
58#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg) 58#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME , ## arg)
@@ -287,7 +287,7 @@ static int __init init_slots(void)
287 hotplug_slot->release = &release_slot; 287 hotplug_slot->release = &release_slot;
288 make_slot_name(slot); 288 make_slot_name(slot);
289 hotplug_slot->ops = &skel_hotplug_slot_ops; 289 hotplug_slot->ops = &skel_hotplug_slot_ops;
290 290
291 /* 291 /*
292 * Initialize the slot info structure with some known 292 * Initialize the slot info structure with some known
293 * good values. 293 * good values.
@@ -296,7 +296,7 @@ static int __init init_slots(void)
296 get_attention_status(hotplug_slot, &info->attention_status); 296 get_attention_status(hotplug_slot, &info->attention_status);
297 get_latch_status(hotplug_slot, &info->latch_status); 297 get_latch_status(hotplug_slot, &info->latch_status);
298 get_adapter_status(hotplug_slot, &info->adapter_status); 298 get_adapter_status(hotplug_slot, &info->adapter_status);
299 299
300 dbg("registering slot %d\n", i); 300 dbg("registering slot %d\n", i);
301 retval = pci_hp_register(slot->hotplug_slot); 301 retval = pci_hp_register(slot->hotplug_slot);
302 if (retval) { 302 if (retval) {
@@ -336,7 +336,7 @@ static void __exit cleanup_slots(void)
336 pci_hp_deregister(slot->hotplug_slot); 336 pci_hp_deregister(slot->hotplug_slot);
337 } 337 }
338} 338}
339 339
340static int __init pcihp_skel_init(void) 340static int __init pcihp_skel_init(void)
341{ 341{
342 int retval; 342 int retval;
diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c
index bb7af78e4eed..e9c044d15add 100644
--- a/drivers/pci/hotplug/rpadlpar_core.c
+++ b/drivers/pci/hotplug/rpadlpar_core.c
@@ -217,7 +217,7 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
217 if (!pcibios_find_pci_bus(dn)) 217 if (!pcibios_find_pci_bus(dn))
218 return -EINVAL; 218 return -EINVAL;
219 219
220 /* If pci slot is hotplugable, use hotplug to remove it */ 220 /* If pci slot is hotpluggable, use hotplug to remove it */
221 slot = find_php_slot(dn); 221 slot = find_php_slot(dn);
222 if (slot && rpaphp_deregister_slot(slot)) { 222 if (slot && rpaphp_deregister_slot(slot)) {
223 printk(KERN_ERR "%s: unable to remove hotplug slot %s\n", 223 printk(KERN_ERR "%s: unable to remove hotplug slot %s\n",
diff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h
index 3135856e5e1c..b2593e876a09 100644
--- a/drivers/pci/hotplug/rpaphp.h
+++ b/drivers/pci/hotplug/rpaphp.h
@@ -49,9 +49,9 @@
49extern bool rpaphp_debug; 49extern bool rpaphp_debug;
50#define dbg(format, arg...) \ 50#define dbg(format, arg...) \
51 do { \ 51 do { \
52 if (rpaphp_debug) \ 52 if (rpaphp_debug) \
53 printk(KERN_DEBUG "%s: " format, \ 53 printk(KERN_DEBUG "%s: " format, \
54 MY_NAME , ## arg); \ 54 MY_NAME , ## arg); \
55 } while (0) 55 } while (0)
56#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg) 56#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
57#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg) 57#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
@@ -99,5 +99,5 @@ void dealloc_slot_struct(struct slot *slot);
99struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain); 99struct slot *alloc_slot_struct(struct device_node *dn, int drc_index, char *drc_name, int power_domain);
100int rpaphp_register_slot(struct slot *slot); 100int rpaphp_register_slot(struct slot *slot);
101int rpaphp_deregister_slot(struct slot *slot); 101int rpaphp_deregister_slot(struct slot *slot);
102 102
103#endif /* _PPC64PHP_H */ 103#endif /* _PPC64PHP_H */
diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c
index 127d6e600185..b7fc5c9255a5 100644
--- a/drivers/pci/hotplug/rpaphp_core.c
+++ b/drivers/pci/hotplug/rpaphp_core.c
@@ -226,7 +226,7 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,
226 for (i = 0; i < indexes[0]; i++) { 226 for (i = 0; i < indexes[0]; i++) {
227 if ((unsigned int) indexes[i + 1] == *my_index) { 227 if ((unsigned int) indexes[i + 1] == *my_index) {
228 if (drc_name) 228 if (drc_name)
229 *drc_name = name_tmp; 229 *drc_name = name_tmp;
230 if (drc_type) 230 if (drc_type)
231 *drc_type = type_tmp; 231 *drc_type = type_tmp;
232 if (drc_index) 232 if (drc_index)
@@ -289,7 +289,7 @@ static int is_php_dn(struct device_node *dn, const int **indexes,
289 * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem. 289 * rpaphp_add_slot -- declare a hotplug slot to the hotplug subsystem.
290 * @dn: device node of slot 290 * @dn: device node of slot
291 * 291 *
292 * This subroutine will register a hotplugable slot with the 292 * This subroutine will register a hotpluggable slot with the
293 * PCI hotplug infrastructure. This routine is typically called 293 * PCI hotplug infrastructure. This routine is typically called
294 * during boot time, if the hotplug slots are present at boot time, 294 * during boot time, if the hotplug slots are present at boot time,
295 * or is called later, by the dlpar add code, if the slot is 295 * or is called later, by the dlpar add code, if the slot is
@@ -328,7 +328,7 @@ int rpaphp_add_slot(struct device_node *dn)
328 return -ENOMEM; 328 return -ENOMEM;
329 329
330 slot->type = simple_strtoul(type, NULL, 10); 330 slot->type = simple_strtoul(type, NULL, 10);
331 331
332 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n", 332 dbg("Found drc-index:0x%x drc-name:%s drc-type:%s\n",
333 indexes[i + 1], name, type); 333 indexes[i + 1], name, type);
334 334
@@ -356,7 +356,7 @@ static void __exit cleanup_slots(void)
356 /* 356 /*
357 * Unregister all of our slots with the pci_hotplug subsystem, 357 * Unregister all of our slots with the pci_hotplug subsystem,
358 * and free up all memory that we had allocated. 358 * and free up all memory that we had allocated.
359 * memory will be freed in release_slot callback. 359 * memory will be freed in release_slot callback.
360 */ 360 */
361 361
362 list_for_each_safe(tmp, n, &rpaphp_slot_head) { 362 list_for_each_safe(tmp, n, &rpaphp_slot_head) {
diff --git a/drivers/pci/hotplug/rpaphp_pci.c b/drivers/pci/hotplug/rpaphp_pci.c
index 513e1e282391..9243f3e7a1c9 100644
--- a/drivers/pci/hotplug/rpaphp_pci.c
+++ b/drivers/pci/hotplug/rpaphp_pci.c
@@ -44,7 +44,7 @@ int rpaphp_get_sensor_state(struct slot *slot, int *state)
44 dbg("%s: slot must be power up to get sensor-state\n", 44 dbg("%s: slot must be power up to get sensor-state\n",
45 __func__); 45 __func__);
46 46
47 /* some slots have to be powered up 47 /* some slots have to be powered up
48 * before get-sensor will succeed. 48 * before get-sensor will succeed.
49 */ 49 */
50 rc = rtas_set_power_level(slot->power_domain, POWER_ON, 50 rc = rtas_set_power_level(slot->power_domain, POWER_ON,
@@ -133,4 +133,3 @@ int rpaphp_enable_slot(struct slot *slot)
133 133
134 return 0; 134 return 0;
135} 135}
136
diff --git a/drivers/pci/hotplug/rpaphp_slot.c b/drivers/pci/hotplug/rpaphp_slot.c
index b283bbea6d24..a6082cc263f7 100644
--- a/drivers/pci/hotplug/rpaphp_slot.c
+++ b/drivers/pci/hotplug/rpaphp_slot.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * RPA Virtual I/O device functions 2 * RPA Virtual I/O device functions
3 * Copyright (C) 2004 Linda Xie <lxie@us.ibm.com> 3 * Copyright (C) 2004 Linda Xie <lxie@us.ibm.com>
4 * 4 *
5 * All rights reserved. 5 * All rights reserved.
@@ -51,27 +51,27 @@ struct slot *alloc_slot_struct(struct device_node *dn,
51 int drc_index, char *drc_name, int power_domain) 51 int drc_index, char *drc_name, int power_domain)
52{ 52{
53 struct slot *slot; 53 struct slot *slot;
54 54
55 slot = kzalloc(sizeof(struct slot), GFP_KERNEL); 55 slot = kzalloc(sizeof(struct slot), GFP_KERNEL);
56 if (!slot) 56 if (!slot)
57 goto error_nomem; 57 goto error_nomem;
58 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL); 58 slot->hotplug_slot = kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
59 if (!slot->hotplug_slot) 59 if (!slot->hotplug_slot)
60 goto error_slot; 60 goto error_slot;
61 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info), 61 slot->hotplug_slot->info = kzalloc(sizeof(struct hotplug_slot_info),
62 GFP_KERNEL); 62 GFP_KERNEL);
63 if (!slot->hotplug_slot->info) 63 if (!slot->hotplug_slot->info)
64 goto error_hpslot; 64 goto error_hpslot;
65 slot->name = kstrdup(drc_name, GFP_KERNEL); 65 slot->name = kstrdup(drc_name, GFP_KERNEL);
66 if (!slot->name) 66 if (!slot->name)
67 goto error_info; 67 goto error_info;
68 slot->dn = dn; 68 slot->dn = dn;
69 slot->index = drc_index; 69 slot->index = drc_index;
70 slot->power_domain = power_domain; 70 slot->power_domain = power_domain;
71 slot->hotplug_slot->private = slot; 71 slot->hotplug_slot->private = slot;
72 slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops; 72 slot->hotplug_slot->ops = &rpaphp_hotplug_slot_ops;
73 slot->hotplug_slot->release = &rpaphp_release_slot; 73 slot->hotplug_slot->release = &rpaphp_release_slot;
74 74
75 return (slot); 75 return (slot);
76 76
77error_info: 77error_info:
@@ -91,7 +91,7 @@ static int is_registered(struct slot *slot)
91 list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) { 91 list_for_each_entry(tmp_slot, &rpaphp_slot_head, rpaphp_slot_list) {
92 if (!strcmp(tmp_slot->name, slot->name)) 92 if (!strcmp(tmp_slot->name, slot->name))
93 return 1; 93 return 1;
94 } 94 }
95 return 0; 95 return 0;
96} 96}
97 97
@@ -104,7 +104,7 @@ int rpaphp_deregister_slot(struct slot *slot)
104 __func__, slot->name); 104 __func__, slot->name);
105 105
106 list_del(&slot->rpaphp_slot_list); 106 list_del(&slot->rpaphp_slot_list);
107 107
108 retval = pci_hp_deregister(php_slot); 108 retval = pci_hp_deregister(php_slot);
109 if (retval) 109 if (retval)
110 err("Problem unregistering a slot %s\n", slot->name); 110 err("Problem unregistering a slot %s\n", slot->name);
@@ -120,7 +120,7 @@ int rpaphp_register_slot(struct slot *slot)
120 int retval; 120 int retval;
121 int slotno; 121 int slotno;
122 122
123 dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", 123 dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n",
124 __func__, slot->dn->full_name, slot->index, slot->name, 124 __func__, slot->dn->full_name, slot->index, slot->name,
125 slot->power_domain, slot->type); 125 slot->power_domain, slot->type);
126 126
@@ -128,7 +128,7 @@ int rpaphp_register_slot(struct slot *slot)
128 if (is_registered(slot)) { 128 if (is_registered(slot)) {
129 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name); 129 err("rpaphp_register_slot: slot[%s] is already registered\n", slot->name);
130 return -EAGAIN; 130 return -EAGAIN;
131 } 131 }
132 132
133 if (slot->dn->child) 133 if (slot->dn->child)
134 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn); 134 slotno = PCI_SLOT(PCI_DN(slot->dn->child)->devfn);
@@ -145,4 +145,3 @@ int rpaphp_register_slot(struct slot *slot)
145 info("Slot [%s] registered\n", slot->name); 145 info("Slot [%s] registered\n", slot->name);
146 return 0; 146 return 0;
147} 147}
148
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index d876e4b3c6a9..61529097464d 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -216,13 +216,13 @@ struct ctrl_reg {
216 216
217/* offsets to the controller registers based on the above structure layout */ 217/* offsets to the controller registers based on the above structure layout */
218enum ctrl_offsets { 218enum ctrl_offsets {
219 BASE_OFFSET = offsetof(struct ctrl_reg, base_offset), 219 BASE_OFFSET = offsetof(struct ctrl_reg, base_offset),
220 SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1), 220 SLOT_AVAIL1 = offsetof(struct ctrl_reg, slot_avail1),
221 SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2), 221 SLOT_AVAIL2 = offsetof(struct ctrl_reg, slot_avail2),
222 SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config), 222 SLOT_CONFIG = offsetof(struct ctrl_reg, slot_config),
223 SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config), 223 SEC_BUS_CONFIG = offsetof(struct ctrl_reg, sec_bus_config),
224 MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl), 224 MSI_CTRL = offsetof(struct ctrl_reg, msi_ctrl),
225 PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface), 225 PROG_INTERFACE = offsetof(struct ctrl_reg, prog_interface),
226 CMD = offsetof(struct ctrl_reg, cmd), 226 CMD = offsetof(struct ctrl_reg, cmd),
227 CMD_STATUS = offsetof(struct ctrl_reg, cmd_status), 227 CMD_STATUS = offsetof(struct ctrl_reg, cmd_status),
228 INTR_LOC = offsetof(struct ctrl_reg, intr_loc), 228 INTR_LOC = offsetof(struct ctrl_reg, intr_loc),
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index d3f757df691c..faf13abd5b99 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -143,11 +143,11 @@ static int init_slots(struct controller *ctrl)
143 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); 143 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number);
144 hotplug_slot->ops = &shpchp_hotplug_slot_ops; 144 hotplug_slot->ops = &shpchp_hotplug_slot_ops;
145 145
146 ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x " 146 ctrl_dbg(ctrl, "Registering domain:bus:dev=%04x:%02x:%02x "
147 "hp_slot=%x sun=%x slot_device_offset=%x\n", 147 "hp_slot=%x sun=%x slot_device_offset=%x\n",
148 pci_domain_nr(ctrl->pci_dev->subordinate), 148 pci_domain_nr(ctrl->pci_dev->subordinate),
149 slot->bus, slot->device, slot->hp_slot, slot->number, 149 slot->bus, slot->device, slot->hp_slot, slot->number,
150 ctrl->slot_device_offset); 150 ctrl->slot_device_offset);
151 retval = pci_hp_register(slot->hotplug_slot, 151 retval = pci_hp_register(slot->hotplug_slot,
152 ctrl->pci_dev->subordinate, slot->device, name); 152 ctrl->pci_dev->subordinate, slot->device, name);
153 if (retval) { 153 if (retval) {
diff --git a/drivers/pci/hotplug/shpchp_hpc.c b/drivers/pci/hotplug/shpchp_hpc.c
index 75ba2311b54f..2d7f474ca0ec 100644
--- a/drivers/pci/hotplug/shpchp_hpc.c
+++ b/drivers/pci/hotplug/shpchp_hpc.c
@@ -116,7 +116,7 @@
116#define SLOT_REG_RSVDZ_MASK ((1 << 15) | (7 << 21)) 116#define SLOT_REG_RSVDZ_MASK ((1 << 15) | (7 << 21))
117 117
118/* 118/*
119 * SHPC Command Code definitnions 119 * SHPC Command Code definitions
120 * 120 *
121 * Slot Operation 00h - 3Fh 121 * Slot Operation 00h - 3Fh
122 * Set Bus Segment Speed/Mode A 40h - 47h 122 * Set Bus Segment Speed/Mode A 40h - 47h