diff options
author | Alex Chiang <achiang@hp.com> | 2009-03-31 11:23:11 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-11 15:04:07 -0400 |
commit | 861fefbf550d41e7a4f44584f3ec35977fa08bf1 (patch) | |
tree | e7fd059f852d225f5270bd5ef0a367eab06a6a8f /drivers/pci/hotplug/cpqphp_ctrl.c | |
parent | d09ee9687e027fc7d2c6b95daf05a8ef3ff06340 (diff) |
PCI Hotplug: cpqphp: stray whitespace cleanups
Clean up all stray whitespace issues, such as trailing whitespace,
spaces before tabs, etc. and whatever else vim's c_space_errors
highlights in red.
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_ctrl.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index cc227a8c4b11..ec3a76519af2 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -642,7 +642,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz | |||
642 | return NULL; | 642 | return NULL; |
643 | 643 | ||
644 | for (max = *head; max; max = max->next) { | 644 | for (max = *head; max; max = max->next) { |
645 | /* If not big enough we could probably just bail, | 645 | /* If not big enough we could probably just bail, |
646 | * instead we'll continue to the next. */ | 646 | * instead we'll continue to the next. */ |
647 | if (max->length < size) | 647 | if (max->length < size) |
648 | continue; | 648 | continue; |
@@ -886,7 +886,7 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data) | |||
886 | u32 Diff; | 886 | u32 Diff; |
887 | u32 temp_dword; | 887 | u32 temp_dword; |
888 | 888 | ||
889 | 889 | ||
890 | misc = readw(ctrl->hpc_reg + MISC); | 890 | misc = readw(ctrl->hpc_reg + MISC); |
891 | /*************************************** | 891 | /*************************************** |
892 | * Check to see if it was our interrupt | 892 | * Check to see if it was our interrupt |
@@ -1130,33 +1130,33 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1130 | u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); | 1130 | u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); |
1131 | u16 reg16; | 1131 | u16 reg16; |
1132 | u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); | 1132 | u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); |
1133 | 1133 | ||
1134 | if (ctrl->speed == adapter_speed) | 1134 | if (ctrl->speed == adapter_speed) |
1135 | return 0; | 1135 | return 0; |
1136 | 1136 | ||
1137 | /* We don't allow freq/mode changes if we find another adapter running | 1137 | /* We don't allow freq/mode changes if we find another adapter running |
1138 | * in another slot on this controller */ | 1138 | * in another slot on this controller */ |
1139 | for(slot = ctrl->slot; slot; slot = slot->next) { | 1139 | for(slot = ctrl->slot; slot; slot = slot->next) { |
1140 | if (slot->device == (hp_slot + ctrl->slot_device_offset)) | 1140 | if (slot->device == (hp_slot + ctrl->slot_device_offset)) |
1141 | continue; | 1141 | continue; |
1142 | if (!slot->hotplug_slot || !slot->hotplug_slot->info) | 1142 | if (!slot->hotplug_slot || !slot->hotplug_slot->info) |
1143 | continue; | 1143 | continue; |
1144 | if (slot->hotplug_slot->info->adapter_status == 0) | 1144 | if (slot->hotplug_slot->info->adapter_status == 0) |
1145 | continue; | 1145 | continue; |
1146 | /* If another adapter is running on the same segment but at a | 1146 | /* If another adapter is running on the same segment but at a |
1147 | * lower speed/mode, we allow the new adapter to function at | 1147 | * lower speed/mode, we allow the new adapter to function at |
1148 | * this rate if supported */ | 1148 | * this rate if supported */ |
1149 | if (ctrl->speed < adapter_speed) | 1149 | if (ctrl->speed < adapter_speed) |
1150 | return 0; | 1150 | return 0; |
1151 | 1151 | ||
1152 | return 1; | 1152 | return 1; |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | /* If the controller doesn't support freq/mode changes and the | 1155 | /* If the controller doesn't support freq/mode changes and the |
1156 | * controller is running at a higher mode, we bail */ | 1156 | * controller is running at a higher mode, we bail */ |
1157 | if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) | 1157 | if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) |
1158 | return 1; | 1158 | return 1; |
1159 | 1159 | ||
1160 | /* But we allow the adapter to run at a lower rate if possible */ | 1160 | /* But we allow the adapter to run at a lower rate if possible */ |
1161 | if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) | 1161 | if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) |
1162 | return 0; | 1162 | return 0; |
@@ -1171,22 +1171,22 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1171 | 1171 | ||
1172 | writel(0x0L, ctrl->hpc_reg + LED_CONTROL); | 1172 | writel(0x0L, ctrl->hpc_reg + LED_CONTROL); |
1173 | writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); | 1173 | writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); |
1174 | 1174 | ||
1175 | set_SOGO(ctrl); | 1175 | set_SOGO(ctrl); |
1176 | wait_for_ctrl_irq(ctrl); | 1176 | wait_for_ctrl_irq(ctrl); |
1177 | 1177 | ||
1178 | if (adapter_speed != PCI_SPEED_133MHz_PCIX) | 1178 | if (adapter_speed != PCI_SPEED_133MHz_PCIX) |
1179 | reg = 0xF5; | 1179 | reg = 0xF5; |
1180 | else | 1180 | else |
1181 | reg = 0xF4; | 1181 | reg = 0xF4; |
1182 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); | 1182 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); |
1183 | 1183 | ||
1184 | reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); | 1184 | reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); |
1185 | reg16 &= ~0x000F; | 1185 | reg16 &= ~0x000F; |
1186 | switch(adapter_speed) { | 1186 | switch(adapter_speed) { |
1187 | case(PCI_SPEED_133MHz_PCIX): | 1187 | case(PCI_SPEED_133MHz_PCIX): |
1188 | reg = 0x75; | 1188 | reg = 0x75; |
1189 | reg16 |= 0xB; | 1189 | reg16 |= 0xB; |
1190 | break; | 1190 | break; |
1191 | case(PCI_SPEED_100MHz_PCIX): | 1191 | case(PCI_SPEED_100MHz_PCIX): |
1192 | reg = 0x74; | 1192 | reg = 0x74; |
@@ -1203,47 +1203,47 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1203 | default: /* 33MHz PCI 2.2 */ | 1203 | default: /* 33MHz PCI 2.2 */ |
1204 | reg = 0x71; | 1204 | reg = 0x71; |
1205 | break; | 1205 | break; |
1206 | 1206 | ||
1207 | } | 1207 | } |
1208 | reg16 |= 0xB << 12; | 1208 | reg16 |= 0xB << 12; |
1209 | writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); | 1209 | writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); |
1210 | 1210 | ||
1211 | mdelay(5); | 1211 | mdelay(5); |
1212 | 1212 | ||
1213 | /* Reenable interrupts */ | 1213 | /* Reenable interrupts */ |
1214 | writel(0, ctrl->hpc_reg + INT_MASK); | 1214 | writel(0, ctrl->hpc_reg + INT_MASK); |
1215 | 1215 | ||
1216 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); | 1216 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); |
1217 | 1217 | ||
1218 | /* Restart state machine */ | 1218 | /* Restart state machine */ |
1219 | reg = ~0xF; | 1219 | reg = ~0xF; |
1220 | pci_read_config_byte(ctrl->pci_dev, 0x43, ®); | 1220 | pci_read_config_byte(ctrl->pci_dev, 0x43, ®); |
1221 | pci_write_config_byte(ctrl->pci_dev, 0x43, reg); | 1221 | pci_write_config_byte(ctrl->pci_dev, 0x43, reg); |
1222 | 1222 | ||
1223 | /* Only if mode change...*/ | 1223 | /* Only if mode change...*/ |
1224 | if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || | 1224 | if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || |
1225 | ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) | 1225 | ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) |
1226 | set_SOGO(ctrl); | 1226 | set_SOGO(ctrl); |
1227 | 1227 | ||
1228 | wait_for_ctrl_irq(ctrl); | 1228 | wait_for_ctrl_irq(ctrl); |
1229 | mdelay(1100); | 1229 | mdelay(1100); |
1230 | 1230 | ||
1231 | /* Restore LED/Slot state */ | 1231 | /* Restore LED/Slot state */ |
1232 | writel(leds, ctrl->hpc_reg + LED_CONTROL); | 1232 | writel(leds, ctrl->hpc_reg + LED_CONTROL); |
1233 | writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); | 1233 | writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); |
1234 | 1234 | ||
1235 | set_SOGO(ctrl); | 1235 | set_SOGO(ctrl); |
1236 | wait_for_ctrl_irq(ctrl); | 1236 | wait_for_ctrl_irq(ctrl); |
1237 | 1237 | ||
1238 | ctrl->speed = adapter_speed; | 1238 | ctrl->speed = adapter_speed; |
1239 | slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 1239 | slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
1240 | 1240 | ||
1241 | info("Successfully changed frequency/mode for adapter in slot %d\n", | 1241 | info("Successfully changed frequency/mode for adapter in slot %d\n", |
1242 | slot->number); | 1242 | slot->number); |
1243 | return 0; | 1243 | return 0; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | /* the following routines constitute the bulk of the | 1246 | /* the following routines constitute the bulk of the |
1247 | hotplug controller logic | 1247 | hotplug controller logic |
1248 | */ | 1248 | */ |
1249 | 1249 | ||
@@ -1299,7 +1299,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl) | |||
1299 | 1299 | ||
1300 | /* Wait for SOBS to be unset */ | 1300 | /* Wait for SOBS to be unset */ |
1301 | wait_for_ctrl_irq (ctrl); | 1301 | wait_for_ctrl_irq (ctrl); |
1302 | 1302 | ||
1303 | adapter_speed = get_adapter_speed(ctrl, hp_slot); | 1303 | adapter_speed = get_adapter_speed(ctrl, hp_slot); |
1304 | if (ctrl->speed != adapter_speed) | 1304 | if (ctrl->speed != adapter_speed) |
1305 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) | 1305 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) |
@@ -1443,12 +1443,12 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1443 | 1443 | ||
1444 | /* Wait for SOBS to be unset */ | 1444 | /* Wait for SOBS to be unset */ |
1445 | wait_for_ctrl_irq (ctrl); | 1445 | wait_for_ctrl_irq (ctrl); |
1446 | 1446 | ||
1447 | adapter_speed = get_adapter_speed(ctrl, hp_slot); | 1447 | adapter_speed = get_adapter_speed(ctrl, hp_slot); |
1448 | if (ctrl->speed != adapter_speed) | 1448 | if (ctrl->speed != adapter_speed) |
1449 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) | 1449 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) |
1450 | rc = WRONG_BUS_FREQUENCY; | 1450 | rc = WRONG_BUS_FREQUENCY; |
1451 | 1451 | ||
1452 | /* turn off board without attaching to the bus */ | 1452 | /* turn off board without attaching to the bus */ |
1453 | disable_slot_power (ctrl, hp_slot); | 1453 | disable_slot_power (ctrl, hp_slot); |
1454 | 1454 | ||
@@ -1461,7 +1461,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1461 | 1461 | ||
1462 | if (rc) | 1462 | if (rc) |
1463 | return rc; | 1463 | return rc; |
1464 | 1464 | ||
1465 | p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 1465 | p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
1466 | 1466 | ||
1467 | /* turn on board and blink green LED */ | 1467 | /* turn on board and blink green LED */ |
@@ -1859,12 +1859,12 @@ static void interrupt_event_handler(struct controller *ctrl) | |||
1859 | info(msg_button_on, p_slot->number); | 1859 | info(msg_button_on, p_slot->number); |
1860 | } | 1860 | } |
1861 | mutex_lock(&ctrl->crit_sect); | 1861 | mutex_lock(&ctrl->crit_sect); |
1862 | 1862 | ||
1863 | dbg("blink green LED and turn off amber\n"); | 1863 | dbg("blink green LED and turn off amber\n"); |
1864 | 1864 | ||
1865 | amber_LED_off (ctrl, hp_slot); | 1865 | amber_LED_off (ctrl, hp_slot); |
1866 | green_LED_blink (ctrl, hp_slot); | 1866 | green_LED_blink (ctrl, hp_slot); |
1867 | 1867 | ||
1868 | set_SOGO(ctrl); | 1868 | set_SOGO(ctrl); |
1869 | 1869 | ||
1870 | /* Wait for SOBS to be unset */ | 1870 | /* Wait for SOBS to be unset */ |
@@ -1958,7 +1958,7 @@ void cpqhp_pushbutton_thread(unsigned long slot) | |||
1958 | if (cpqhp_process_SI(ctrl, func) != 0) { | 1958 | if (cpqhp_process_SI(ctrl, func) != 0) { |
1959 | amber_LED_on(ctrl, hp_slot); | 1959 | amber_LED_on(ctrl, hp_slot); |
1960 | green_LED_off(ctrl, hp_slot); | 1960 | green_LED_off(ctrl, hp_slot); |
1961 | 1961 | ||
1962 | set_SOGO(ctrl); | 1962 | set_SOGO(ctrl); |
1963 | 1963 | ||
1964 | /* Wait for SOBS to be unset */ | 1964 | /* Wait for SOBS to be unset */ |
@@ -2079,7 +2079,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) | |||
2079 | struct pci_bus *pci_bus = ctrl->pci_bus; | 2079 | struct pci_bus *pci_bus = ctrl->pci_bus; |
2080 | int physical_slot=0; | 2080 | int physical_slot=0; |
2081 | 2081 | ||
2082 | device = func->device; | 2082 | device = func->device; |
2083 | func = cpqhp_slot_find(ctrl->bus, device, index++); | 2083 | func = cpqhp_slot_find(ctrl->bus, device, index++); |
2084 | p_slot = cpqhp_find_slot(ctrl, device); | 2084 | p_slot = cpqhp_find_slot(ctrl, device); |
2085 | if (p_slot) { | 2085 | if (p_slot) { |
@@ -2216,7 +2216,7 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) | |||
2216 | long_delay((3*HZ)/10); | 2216 | long_delay((3*HZ)/10); |
2217 | work_LED = work_LED >> 16; | 2217 | work_LED = work_LED >> 16; |
2218 | writel(work_LED, ctrl->hpc_reg + LED_CONTROL); | 2218 | writel(work_LED, ctrl->hpc_reg + LED_CONTROL); |
2219 | 2219 | ||
2220 | set_SOGO(ctrl); | 2220 | set_SOGO(ctrl); |
2221 | 2221 | ||
2222 | /* Wait for SOGO interrupt */ | 2222 | /* Wait for SOGO interrupt */ |
@@ -2339,7 +2339,7 @@ static u32 configure_new_device(struct controller * ctrl, struct pci_func * func | |||
2339 | 2339 | ||
2340 | 2340 | ||
2341 | /* | 2341 | /* |
2342 | Configuration logic that involves the hotplug data structures and | 2342 | Configuration logic that involves the hotplug data structures and |
2343 | their bookkeeping | 2343 | their bookkeeping |
2344 | */ | 2344 | */ |
2345 | 2345 | ||
@@ -2917,17 +2917,17 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func | |||
2917 | } /* End of base register loop */ | 2917 | } /* End of base register loop */ |
2918 | if (cpqhp_legacy_mode) { | 2918 | if (cpqhp_legacy_mode) { |
2919 | /* Figure out which interrupt pin this function uses */ | 2919 | /* Figure out which interrupt pin this function uses */ |
2920 | rc = pci_bus_read_config_byte (pci_bus, devfn, | 2920 | rc = pci_bus_read_config_byte (pci_bus, devfn, |
2921 | PCI_INTERRUPT_PIN, &temp_byte); | 2921 | PCI_INTERRUPT_PIN, &temp_byte); |
2922 | 2922 | ||
2923 | /* If this function needs an interrupt and we are behind | 2923 | /* If this function needs an interrupt and we are behind |
2924 | * a bridge and the pin is tied to something that's | 2924 | * a bridge and the pin is tied to something that's |
2925 | * alread mapped, set this one the same */ | 2925 | * alread mapped, set this one the same */ |
2926 | if (temp_byte && resources->irqs && | 2926 | if (temp_byte && resources->irqs && |
2927 | (resources->irqs->valid_INT & | 2927 | (resources->irqs->valid_INT & |
2928 | (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { | 2928 | (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { |
2929 | /* We have to share with something already set up */ | 2929 | /* We have to share with something already set up */ |
2930 | IRQ = resources->irqs->interrupt[(temp_byte + | 2930 | IRQ = resources->irqs->interrupt[(temp_byte + |
2931 | resources->irqs->barber_pole - 1) & 0x03]; | 2931 | resources->irqs->barber_pole - 1) & 0x03]; |
2932 | } else { | 2932 | } else { |
2933 | /* Program IRQ based on card type */ | 2933 | /* Program IRQ based on card type */ |