diff options
author | Taku Izumi <izumi.taku@jp.fujitsu.com> | 2008-10-22 22:54:39 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-10-23 19:14:00 -0400 |
commit | be7bce250a88fbbb5a67204eb148bce8b798780a (patch) | |
tree | c30a5f7f145e4b4ab59f139b529eb170fa00f682 /drivers/pci/hotplug/shpchp_ctrl.c | |
parent | f98ca311f3a32e2adc229fecd6bf732db07fcca3 (diff) |
PCI hotplug: shpchp: message refinement
This patch refines messages in shpchp module. The main changes are as
follows:
- remove the trailing "."
- remove __func__ as much as possible
- capitalize the first letter of messages
- show PCI device address including its domain
Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/shpchp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index c9049f17864e..b8ab2796e66a 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -62,7 +62,7 @@ u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl) | |||
62 | u32 event_type; | 62 | u32 event_type; |
63 | 63 | ||
64 | /* Attention Button Change */ | 64 | /* Attention Button Change */ |
65 | ctrl_dbg(ctrl, "Attention button interrupt received.\n"); | 65 | ctrl_dbg(ctrl, "Attention button interrupt received\n"); |
66 | 66 | ||
67 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 67 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
68 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); | 68 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); |
@@ -86,13 +86,13 @@ u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl) | |||
86 | u32 event_type; | 86 | u32 event_type; |
87 | 87 | ||
88 | /* Switch Change */ | 88 | /* Switch Change */ |
89 | ctrl_dbg(ctrl, "Switch interrupt received.\n"); | 89 | ctrl_dbg(ctrl, "Switch interrupt received\n"); |
90 | 90 | ||
91 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 91 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
92 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); | 92 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); |
93 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 93 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
94 | ctrl_dbg(ctrl, "%s: Card present %x Power status %x\n", | 94 | ctrl_dbg(ctrl, "Card present %x Power status %x\n", |
95 | __func__, p_slot->presence_save, p_slot->pwr_save); | 95 | p_slot->presence_save, p_slot->pwr_save); |
96 | 96 | ||
97 | if (getstatus) { | 97 | if (getstatus) { |
98 | /* | 98 | /* |
@@ -123,7 +123,7 @@ u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl) | |||
123 | u32 event_type; | 123 | u32 event_type; |
124 | 124 | ||
125 | /* Presence Change */ | 125 | /* Presence Change */ |
126 | ctrl_dbg(ctrl, "Presence/Notify input change.\n"); | 126 | ctrl_dbg(ctrl, "Presence/Notify input change\n"); |
127 | 127 | ||
128 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 128 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
129 | 129 | ||
@@ -158,7 +158,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) | |||
158 | u32 event_type; | 158 | u32 event_type; |
159 | 159 | ||
160 | /* Power fault */ | 160 | /* Power fault */ |
161 | ctrl_dbg(ctrl, "Power fault interrupt received.\n"); | 161 | ctrl_dbg(ctrl, "Power fault interrupt received\n"); |
162 | 162 | ||
163 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 163 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
164 | 164 | ||
@@ -178,7 +178,7 @@ u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) | |||
178 | event_type = INT_POWER_FAULT; | 178 | event_type = INT_POWER_FAULT; |
179 | /* set power fault status for this board */ | 179 | /* set power fault status for this board */ |
180 | p_slot->status = 0xFF; | 180 | p_slot->status = 0xFF; |
181 | ctrl_info(ctrl, "power fault bit %x set\n", hp_slot); | 181 | ctrl_info(ctrl, "Power fault bit %x set\n", hp_slot); |
182 | } | 182 | } |
183 | 183 | ||
184 | queue_interrupt_event(p_slot, event_type); | 184 | queue_interrupt_event(p_slot, event_type); |
@@ -194,7 +194,7 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, | |||
194 | { | 194 | { |
195 | int rc = 0; | 195 | int rc = 0; |
196 | 196 | ||
197 | ctrl_dbg(ctrl, "%s: change to speed %d\n", __func__, speed); | 197 | ctrl_dbg(ctrl, "Change speed to %d\n", speed); |
198 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { | 198 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { |
199 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command " | 199 | ctrl_err(ctrl, "%s: Issue of set bus speed mode command " |
200 | "failed\n", __func__); | 200 | "failed\n", __func__); |
@@ -215,8 +215,8 @@ static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, | |||
215 | */ | 215 | */ |
216 | if (flag) { | 216 | if (flag) { |
217 | if (asp < bsp) { | 217 | if (asp < bsp) { |
218 | ctrl_err(ctrl, "%s: speed of bus %x and adapter %x " | 218 | ctrl_err(ctrl, "Speed of bus %x and adapter %x " |
219 | "mismatch\n", __func__, bsp, asp); | 219 | "mismatch\n", bsp, asp); |
220 | rc = WRONG_BUS_FREQUENCY; | 220 | rc = WRONG_BUS_FREQUENCY; |
221 | } | 221 | } |
222 | return rc; | 222 | return rc; |
@@ -246,6 +246,7 @@ static int board_added(struct slot *p_slot) | |||
246 | int rc = 0; | 246 | int rc = 0; |
247 | enum pci_bus_speed asp, bsp, msp; | 247 | enum pci_bus_speed asp, bsp, msp; |
248 | struct controller *ctrl = p_slot->ctrl; | 248 | struct controller *ctrl = p_slot->ctrl; |
249 | struct pci_bus *parent = ctrl->pci_dev->subordinate; | ||
249 | 250 | ||
250 | hp_slot = p_slot->device - ctrl->slot_device_offset; | 251 | hp_slot = p_slot->device - ctrl->slot_device_offset; |
251 | 252 | ||
@@ -256,7 +257,7 @@ static int board_added(struct slot *p_slot) | |||
256 | /* Power on slot without connecting to bus */ | 257 | /* Power on slot without connecting to bus */ |
257 | rc = p_slot->hpc_ops->power_on_slot(p_slot); | 258 | rc = p_slot->hpc_ops->power_on_slot(p_slot); |
258 | if (rc) { | 259 | if (rc) { |
259 | ctrl_err(ctrl, "%s: Failed to power on slot\n", __func__); | 260 | ctrl_err(ctrl, "Failed to power on slot\n"); |
260 | return -1; | 261 | return -1; |
261 | } | 262 | } |
262 | 263 | ||
@@ -272,29 +273,27 @@ static int board_added(struct slot *p_slot) | |||
272 | 273 | ||
273 | /* turn on board, blink green LED, turn off Amber LED */ | 274 | /* turn on board, blink green LED, turn off Amber LED */ |
274 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { | 275 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { |
275 | ctrl_err(ctrl, "%s: Issue of Slot Enable command" | 276 | ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); |
276 | " failed\n", __func__); | ||
277 | return rc; | 277 | return rc; |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
281 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); | 281 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); |
282 | if (rc) { | 282 | if (rc) { |
283 | ctrl_err(ctrl, "%s: Can't get adapter speed or bus mode " | 283 | ctrl_err(ctrl, "Can't get adapter speed or " |
284 | "mismatch\n", __func__); | 284 | "bus mode mismatch\n"); |
285 | return WRONG_BUS_FREQUENCY; | 285 | return WRONG_BUS_FREQUENCY; |
286 | } | 286 | } |
287 | 287 | ||
288 | rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); | 288 | rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); |
289 | if (rc) { | 289 | if (rc) { |
290 | ctrl_err(ctrl, "%s: Can't get bus operation speed\n", __func__); | 290 | ctrl_err(ctrl, "Can't get bus operation speed\n"); |
291 | return WRONG_BUS_FREQUENCY; | 291 | return WRONG_BUS_FREQUENCY; |
292 | } | 292 | } |
293 | 293 | ||
294 | rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); | 294 | rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); |
295 | if (rc) { | 295 | if (rc) { |
296 | ctrl_err(ctrl, "%s: Can't get max bus operation speed\n", | 296 | ctrl_err(ctrl, "Can't get max bus operation speed\n"); |
297 | __func__); | ||
298 | msp = bsp; | 297 | msp = bsp; |
299 | } | 298 | } |
300 | 299 | ||
@@ -312,8 +311,7 @@ static int board_added(struct slot *p_slot) | |||
312 | 311 | ||
313 | /* turn on board, blink green LED, turn off Amber LED */ | 312 | /* turn on board, blink green LED, turn off Amber LED */ |
314 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { | 313 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { |
315 | ctrl_err(ctrl, "%s: Issue of Slot Enable command failed\n", | 314 | ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); |
316 | __func__); | ||
317 | return rc; | 315 | return rc; |
318 | } | 316 | } |
319 | 317 | ||
@@ -324,15 +322,15 @@ static int board_added(struct slot *p_slot) | |||
324 | /* Check for a power fault */ | 322 | /* Check for a power fault */ |
325 | if (p_slot->status == 0xFF) { | 323 | if (p_slot->status == 0xFF) { |
326 | /* power fault occurred, but it was benign */ | 324 | /* power fault occurred, but it was benign */ |
327 | ctrl_dbg(ctrl, "%s: power fault\n", __func__); | 325 | ctrl_dbg(ctrl, "%s: Power fault\n", __func__); |
328 | rc = POWER_FAILURE; | 326 | rc = POWER_FAILURE; |
329 | p_slot->status = 0; | 327 | p_slot->status = 0; |
330 | goto err_exit; | 328 | goto err_exit; |
331 | } | 329 | } |
332 | 330 | ||
333 | if (shpchp_configure_device(p_slot)) { | 331 | if (shpchp_configure_device(p_slot)) { |
334 | ctrl_err(ctrl, "Cannot add device at 0x%x:0x%x\n", | 332 | ctrl_err(ctrl, "Cannot add device at %04x:%02x:%02x\n", |
335 | p_slot->bus, p_slot->device); | 333 | pci_domain_nr(parent), p_slot->bus, p_slot->device); |
336 | goto err_exit; | 334 | goto err_exit; |
337 | } | 335 | } |
338 | 336 | ||
@@ -373,7 +371,7 @@ static int remove_board(struct slot *p_slot) | |||
373 | hp_slot = p_slot->device - ctrl->slot_device_offset; | 371 | hp_slot = p_slot->device - ctrl->slot_device_offset; |
374 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 372 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
375 | 373 | ||
376 | ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, hp_slot); | 374 | ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, hp_slot); |
377 | 375 | ||
378 | /* Change status to shutdown */ | 376 | /* Change status to shutdown */ |
379 | if (p_slot->is_a_board) | 377 | if (p_slot->is_a_board) |
@@ -389,8 +387,7 @@ static int remove_board(struct slot *p_slot) | |||
389 | 387 | ||
390 | rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); | 388 | rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); |
391 | if (rc) { | 389 | if (rc) { |
392 | ctrl_err(ctrl, "%s: Issue of Set Attention command failed\n", | 390 | ctrl_err(ctrl, "Issue of Set Attention command failed\n"); |
393 | __func__); | ||
394 | return rc; | 391 | return rc; |
395 | } | 392 | } |
396 | 393 | ||
@@ -526,7 +523,6 @@ static void handle_button_press_event(struct slot *p_slot) | |||
526 | */ | 523 | */ |
527 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", | 524 | ctrl_info(ctrl, "Button cancel on Slot(%s)\n", |
528 | slot_name(p_slot)); | 525 | slot_name(p_slot)); |
529 | ctrl_dbg(ctrl, "%s: button cancel\n", __func__); | ||
530 | cancel_delayed_work(&p_slot->work); | 526 | cancel_delayed_work(&p_slot->work); |
531 | if (p_slot->state == BLINKINGOFF_STATE) | 527 | if (p_slot->state == BLINKINGOFF_STATE) |
532 | p_slot->hpc_ops->green_led_on(p_slot); | 528 | p_slot->hpc_ops->green_led_on(p_slot); |
@@ -565,7 +561,7 @@ static void interrupt_event_handler(struct work_struct *work) | |||
565 | handle_button_press_event(p_slot); | 561 | handle_button_press_event(p_slot); |
566 | break; | 562 | break; |
567 | case INT_POWER_FAULT: | 563 | case INT_POWER_FAULT: |
568 | ctrl_dbg(p_slot->ctrl, "%s: power fault\n", __func__); | 564 | ctrl_dbg(p_slot->ctrl, "%s: Power fault\n", __func__); |
569 | p_slot->hpc_ops->set_attention_status(p_slot, 1); | 565 | p_slot->hpc_ops->set_attention_status(p_slot, 1); |
570 | p_slot->hpc_ops->green_led_off(p_slot); | 566 | p_slot->hpc_ops->green_led_off(p_slot); |
571 | break; | 567 | break; |
@@ -660,7 +656,7 @@ static int shpchp_disable_slot (struct slot *p_slot) | |||
660 | } | 656 | } |
661 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); | 657 | rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); |
662 | if (rc || !getstatus) { | 658 | if (rc || !getstatus) { |
663 | ctrl_info(ctrl, "Already disabled slot(%s)\n", | 659 | ctrl_info(ctrl, "Already disabled on slot(%s)\n", |
664 | slot_name(p_slot)); | 660 | slot_name(p_slot)); |
665 | goto out; | 661 | goto out; |
666 | } | 662 | } |