PCI hotplug: shpchp: replace printk with dev_printk

This patch replaces printks within shpchp module with dev_printks.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by Taku Izumi and committed by Jesse Barnes f98ca311 388c8c16

+224 -159
+20 -3
drivers/pci/hotplug/shpchp.h
··· 59 59 #define warn(format, arg...) \ 60 60 printk(KERN_WARNING "%s: " format, MY_NAME , ## arg) 61 61 62 + #define ctrl_dbg(ctrl, format, arg...) \ 63 + do { \ 64 + if (shpchp_debug) \ 65 + dev_printk(, &ctrl->pci_dev->dev, \ 66 + format, ## arg); \ 67 + } while (0) 68 + #define ctrl_err(ctrl, format, arg...) \ 69 + dev_err(&ctrl->pci_dev->dev, format, ## arg) 70 + #define ctrl_info(ctrl, format, arg...) \ 71 + dev_info(&ctrl->pci_dev->dev, format, ## arg) 72 + #define ctrl_warn(ctrl, format, arg...) \ 73 + dev_warn(&ctrl->pci_dev->dev, format, ## arg) 74 + 75 + 62 76 #define SLOT_NAME_SIZE 10 63 77 struct slot { 64 78 u8 bus; ··· 253 239 return slot; 254 240 } 255 241 256 - err("%s: slot (device=0x%x) not found\n", __func__, device); 242 + ctrl_err(ctrl, "%s: slot (device=0x%x) not found\n", __func__, device); 257 243 return NULL; 258 244 } 259 245 ··· 287 273 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, &pcix_bridge_errors_reg); 288 274 perr_set = pcix_bridge_errors_reg & PERR_OBSERVED_MASK; 289 275 if (perr_set) { 290 - dbg ("%s W1C: Bridge_Errors[ PERR_OBSERVED = %08X]\n",__func__ , perr_set); 276 + ctrl_dbg(p_slot->ctrl, 277 + "%s W1C: Bridge_Errors[ PERR_OBSERVED = %08X]\n", 278 + __func__ , perr_set); 291 279 292 280 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISC_BRIDGE_ERRORS_OFFSET, perr_set); 293 281 } ··· 298 282 pci_read_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, &pcix_mem_base_reg); 299 283 rse_set = pcix_mem_base_reg & RSE_MASK; 300 284 if (rse_set) { 301 - dbg ("%s W1C: Memory_Base_Limit[ RSE ]\n",__func__ ); 285 + ctrl_dbg(p_slot->ctrl, "%s W1C: Memory_Base_Limit[ RSE ]\n", 286 + __func__); 302 287 303 288 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MEM_BASE_LIMIT_OFFSET, rse_set); 304 289 }
+28 -18
drivers/pci/hotplug/shpchp_core.c
··· 89 89 { 90 90 struct slot *slot = hotplug_slot->private; 91 91 92 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 92 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 93 + __func__, slot_name(slot)); 93 94 94 95 kfree(slot->hotplug_slot->info); 95 96 kfree(slot->hotplug_slot); ··· 136 135 snprintf(name, SLOT_NAME_SIZE, "%d", slot->number); 137 136 hotplug_slot->ops = &shpchp_hotplug_slot_ops; 138 137 139 - dbg("Registering bus=%x dev=%x hp_slot=%x sun=%x " 140 - "slot_device_offset=%x\n", slot->bus, slot->device, 141 - slot->hp_slot, slot->number, ctrl->slot_device_offset); 138 + ctrl_dbg(ctrl, "Registering bus=%x dev=%x hp_slot=%x sun=%x " 139 + "slot_device_offset=%x\n", slot->bus, slot->device, 140 + slot->hp_slot, slot->number, ctrl->slot_device_offset); 142 141 retval = pci_hp_register(slot->hotplug_slot, 143 142 ctrl->pci_dev->subordinate, slot->device, name); 144 143 if (retval) { 145 - err("pci_hp_register failed with error %d\n", retval); 144 + ctrl_err(ctrl, "pci_hp_register failed with error %d\n", 145 + retval); 146 146 goto error_info; 147 147 } 148 148 ··· 189 187 { 190 188 struct slot *slot = get_slot(hotplug_slot); 191 189 192 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 190 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 191 + __func__, slot_name(slot)); 193 192 194 193 hotplug_slot->info->attention_status = status; 195 194 slot->hpc_ops->set_attention_status(slot, status); ··· 202 199 { 203 200 struct slot *slot = get_slot(hotplug_slot); 204 201 205 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 202 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 203 + __func__, slot_name(slot)); 206 204 207 205 return shpchp_sysfs_enable_slot(slot); 208 206 } ··· 212 208 { 213 209 struct slot *slot = get_slot(hotplug_slot); 214 210 215 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 211 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 212 + __func__, slot_name(slot)); 216 213 217 214 return shpchp_sysfs_disable_slot(slot); 218 215 } ··· 223 218 struct slot *slot = get_slot(hotplug_slot); 224 219 int retval; 225 220 226 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 221 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 222 + __func__, slot_name(slot)); 227 223 228 224 retval = slot->hpc_ops->get_power_status(slot, value); 229 225 if (retval < 0) ··· 238 232 struct slot *slot = get_slot(hotplug_slot); 239 233 int retval; 240 234 241 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 235 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 236 + __func__, slot_name(slot)); 242 237 243 238 retval = slot->hpc_ops->get_attention_status(slot, value); 244 239 if (retval < 0) ··· 253 246 struct slot *slot = get_slot(hotplug_slot); 254 247 int retval; 255 248 256 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 249 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 250 + __func__, slot_name(slot)); 257 251 258 252 retval = slot->hpc_ops->get_latch_status(slot, value); 259 253 if (retval < 0) ··· 268 260 struct slot *slot = get_slot(hotplug_slot); 269 261 int retval; 270 262 271 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 263 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 264 + __func__, slot_name(slot)); 272 265 273 266 retval = slot->hpc_ops->get_adapter_status(slot, value); 274 267 if (retval < 0) ··· 284 275 struct slot *slot = get_slot(hotplug_slot); 285 276 int retval; 286 277 287 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 278 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 279 + __func__, slot_name(slot)); 288 280 289 281 retval = slot->hpc_ops->get_max_bus_speed(slot, value); 290 282 if (retval < 0) ··· 299 289 struct slot *slot = get_slot(hotplug_slot); 300 290 int retval; 301 291 302 - dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); 292 + ctrl_dbg(slot->ctrl, "%s - physical_slot = %s\n", 293 + __func__, slot_name(slot)); 303 294 304 295 retval = slot->hpc_ops->get_cur_bus_speed(slot, value); 305 296 if (retval < 0) ··· 331 320 332 321 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL); 333 322 if (!ctrl) { 334 - err("%s : out of memory\n", __func__); 323 + dev_err(&pdev->dev, "%s : out of memory\n", __func__); 335 324 goto err_out_none; 336 325 } 337 326 INIT_LIST_HEAD(&ctrl->slot_list); 338 327 339 328 rc = shpc_init(ctrl, pdev); 340 329 if (rc) { 341 - dbg("%s: controller initialization failed\n", 342 - SHPC_MODULE_NAME); 330 + ctrl_dbg(ctrl, "controller initialization failed\n"); 343 331 goto err_out_free_ctrl; 344 332 } 345 333 ··· 347 337 /* Setup the slot information structures */ 348 338 rc = init_slots(ctrl); 349 339 if (rc) { 350 - err("%s: slot initialization failed\n", SHPC_MODULE_NAME); 340 + ctrl_err(ctrl, "slot initialization failed\n"); 351 341 goto err_out_release_ctlr; 352 342 } 353 343
+93 -69
drivers/pci/hotplug/shpchp_ctrl.c
··· 62 62 u32 event_type; 63 63 64 64 /* Attention Button Change */ 65 - dbg("shpchp: Attention button interrupt received.\n"); 65 + ctrl_dbg(ctrl, "Attention button interrupt received.\n"); 66 66 67 67 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 68 68 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); ··· 70 70 /* 71 71 * Button pressed - See if need to TAKE ACTION!!! 72 72 */ 73 - info("Button pressed on Slot(%s)\n", slot_name(p_slot)); 73 + ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot)); 74 74 event_type = INT_BUTTON_PRESS; 75 75 76 76 queue_interrupt_event(p_slot, event_type); ··· 86 86 u32 event_type; 87 87 88 88 /* Switch Change */ 89 - dbg("shpchp: Switch interrupt received.\n"); 89 + ctrl_dbg(ctrl, "Switch interrupt received.\n"); 90 90 91 91 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 92 92 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 93 93 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 94 - dbg("%s: Card present %x Power status %x\n", __func__, 95 - p_slot->presence_save, p_slot->pwr_save); 94 + ctrl_dbg(ctrl, "%s: Card present %x Power status %x\n", 95 + __func__, p_slot->presence_save, p_slot->pwr_save); 96 96 97 97 if (getstatus) { 98 98 /* 99 99 * Switch opened 100 100 */ 101 - info("Latch open on Slot(%s)\n", slot_name(p_slot)); 101 + ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot)); 102 102 event_type = INT_SWITCH_OPEN; 103 103 if (p_slot->pwr_save && p_slot->presence_save) { 104 104 event_type = INT_POWER_FAULT; 105 - err("Surprise Removal of card\n"); 105 + ctrl_err(ctrl, "Surprise Removal of card\n"); 106 106 } 107 107 } else { 108 108 /* 109 109 * Switch closed 110 110 */ 111 - info("Latch close on Slot(%s)\n", slot_name(p_slot)); 111 + ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot)); 112 112 event_type = INT_SWITCH_CLOSE; 113 113 } 114 114 ··· 123 123 u32 event_type; 124 124 125 125 /* Presence Change */ 126 - dbg("shpchp: Presence/Notify input change.\n"); 126 + ctrl_dbg(ctrl, "Presence/Notify input change.\n"); 127 127 128 128 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 129 129 ··· 135 135 /* 136 136 * Card Present 137 137 */ 138 - info("Card present on Slot(%s)\n", slot_name(p_slot)); 138 + ctrl_info(ctrl, "Card present on Slot(%s)\n", 139 + slot_name(p_slot)); 139 140 event_type = INT_PRESENCE_ON; 140 141 } else { 141 142 /* 142 143 * Not Present 143 144 */ 144 - info("Card not present on Slot(%s)\n", slot_name(p_slot)); 145 + ctrl_info(ctrl, "Card not present on Slot(%s)\n", 146 + slot_name(p_slot)); 145 147 event_type = INT_PRESENCE_OFF; 146 148 } 147 149 ··· 158 156 u32 event_type; 159 157 160 158 /* Power fault */ 161 - dbg("shpchp: Power fault interrupt received.\n"); 159 + ctrl_dbg(ctrl, "Power fault interrupt received.\n"); 162 160 163 161 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 164 162 ··· 166 164 /* 167 165 * Power fault Cleared 168 166 */ 169 - info("Power fault cleared on Slot(%s)\n", slot_name(p_slot)); 167 + ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", 168 + slot_name(p_slot)); 170 169 p_slot->status = 0x00; 171 170 event_type = INT_POWER_FAULT_CLEAR; 172 171 } else { 173 172 /* 174 173 * Power fault 175 174 */ 176 - info("Power fault on Slot(%s)\n", slot_name(p_slot)); 175 + ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); 177 176 event_type = INT_POWER_FAULT; 178 177 /* set power fault status for this board */ 179 178 p_slot->status = 0xFF; 180 - info("power fault bit %x set\n", hp_slot); 179 + ctrl_info(ctrl, "power fault bit %x set\n", hp_slot); 181 180 } 182 181 183 182 queue_interrupt_event(p_slot, event_type); ··· 194 191 { 195 192 int rc = 0; 196 193 197 - dbg("%s: change to speed %d\n", __func__, speed); 194 + ctrl_dbg(ctrl, "%s: change to speed %d\n", __func__, speed); 198 195 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { 199 - err("%s: Issue of set bus speed mode command failed\n", 200 - __func__); 196 + ctrl_err(ctrl, "%s: Issue of set bus speed mode command " 197 + "failed\n", __func__); 201 198 return WRONG_BUS_FREQUENCY; 202 199 } 203 200 return rc; ··· 215 212 */ 216 213 if (flag) { 217 214 if (asp < bsp) { 218 - err("%s: speed of bus %x and adapter %x mismatch\n", 219 - __func__, bsp, asp); 215 + ctrl_err(ctrl, "%s: speed of bus %x and adapter %x " 216 + "mismatch\n", __func__, bsp, asp); 220 217 rc = WRONG_BUS_FREQUENCY; 221 218 } 222 219 return rc; ··· 249 246 250 247 hp_slot = p_slot->device - ctrl->slot_device_offset; 251 248 252 - dbg("%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", 253 - __func__, p_slot->device, 254 - ctrl->slot_device_offset, hp_slot); 249 + ctrl_dbg(ctrl, 250 + "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", 251 + __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); 255 252 256 253 /* Power on slot without connecting to bus */ 257 254 rc = p_slot->hpc_ops->power_on_slot(p_slot); 258 255 if (rc) { 259 - err("%s: Failed to power on slot\n", __func__); 256 + ctrl_err(ctrl, "%s: Failed to power on slot\n", __func__); 260 257 return -1; 261 258 } 262 259 ··· 265 262 return WRONG_BUS_FREQUENCY; 266 263 267 264 if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { 268 - err("%s: Issue of set bus speed mode command failed\n", __func__); 265 + ctrl_err(ctrl, "%s: Issue of set bus speed mode command" 266 + " failed\n", __func__); 269 267 return WRONG_BUS_FREQUENCY; 270 268 } 271 269 272 270 /* turn on board, blink green LED, turn off Amber LED */ 273 271 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 274 - err("%s: Issue of Slot Enable command failed\n", __func__); 272 + ctrl_err(ctrl, "%s: Issue of Slot Enable command" 273 + " failed\n", __func__); 275 274 return rc; 276 275 } 277 276 } 278 277 279 278 rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); 280 279 if (rc) { 281 - err("%s: Can't get adapter speed or bus mode mismatch\n", 282 - __func__); 280 + ctrl_err(ctrl, "%s: Can't get adapter speed or bus mode " 281 + "mismatch\n", __func__); 283 282 return WRONG_BUS_FREQUENCY; 284 283 } 285 284 286 285 rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); 287 286 if (rc) { 288 - err("%s: Can't get bus operation speed\n", __func__); 287 + ctrl_err(ctrl, "%s: Can't get bus operation speed\n", __func__); 289 288 return WRONG_BUS_FREQUENCY; 290 289 } 291 290 292 291 rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); 293 292 if (rc) { 294 - err("%s: Can't get max bus operation speed\n", __func__); 293 + ctrl_err(ctrl, "%s: Can't get max bus operation speed\n", 294 + __func__); 295 295 msp = bsp; 296 296 } 297 297 ··· 302 296 if (!list_empty(&ctrl->pci_dev->subordinate->devices)) 303 297 slots_not_empty = 1; 304 298 305 - dbg("%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, " 306 - "max_bus_speed %d\n", __func__, slots_not_empty, asp, 307 - bsp, msp); 299 + ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d," 300 + " max_bus_speed %d\n", __func__, slots_not_empty, asp, 301 + bsp, msp); 308 302 309 303 rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); 310 304 if (rc) ··· 312 306 313 307 /* turn on board, blink green LED, turn off Amber LED */ 314 308 if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { 315 - err("%s: Issue of Slot Enable command failed\n", __func__); 309 + ctrl_err(ctrl, "%s: Issue of Slot Enable command failed\n", 310 + __func__); 316 311 return rc; 317 312 } 318 313 319 314 /* Wait for ~1 second */ 320 315 msleep(1000); 321 316 322 - dbg("%s: slot status = %x\n", __func__, p_slot->status); 317 + ctrl_dbg(ctrl, "%s: slot status = %x\n", __func__, p_slot->status); 323 318 /* Check for a power fault */ 324 319 if (p_slot->status == 0xFF) { 325 320 /* power fault occurred, but it was benign */ 326 - dbg("%s: power fault\n", __func__); 321 + ctrl_dbg(ctrl, "%s: power fault\n", __func__); 327 322 rc = POWER_FAILURE; 328 323 p_slot->status = 0; 329 324 goto err_exit; 330 325 } 331 326 332 327 if (shpchp_configure_device(p_slot)) { 333 - err("Cannot add device at 0x%x:0x%x\n", p_slot->bus, 334 - p_slot->device); 328 + ctrl_err(ctrl, "Cannot add device at 0x%x:0x%x\n", 329 + p_slot->bus, p_slot->device); 335 330 goto err_exit; 336 331 } 337 332 ··· 348 341 /* turn off slot, turn on Amber LED, turn off Green LED */ 349 342 rc = p_slot->hpc_ops->slot_disable(p_slot); 350 343 if (rc) { 351 - err("%s: Issue of Slot Disable command failed\n", __func__); 344 + ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", 345 + __func__); 352 346 return rc; 353 347 } 354 348 ··· 373 365 hp_slot = p_slot->device - ctrl->slot_device_offset; 374 366 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 375 367 376 - dbg("In %s, hp_slot = %d\n", __func__, hp_slot); 368 + ctrl_dbg(ctrl, "In %s, hp_slot = %d\n", __func__, hp_slot); 377 369 378 370 /* Change status to shutdown */ 379 371 if (p_slot->is_a_board) ··· 382 374 /* turn off slot, turn on Amber LED, turn off Green LED */ 383 375 rc = p_slot->hpc_ops->slot_disable(p_slot); 384 376 if (rc) { 385 - err("%s: Issue of Slot Disable command failed\n", __func__); 377 + ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", 378 + __func__); 386 379 return rc; 387 380 } 388 381 389 382 rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); 390 383 if (rc) { 391 - err("%s: Issue of Set Attention command failed\n", __func__); 384 + ctrl_err(ctrl, "%s: Issue of Set Attention command failed\n", 385 + __func__); 392 386 return rc; 393 387 } 394 388 ··· 449 439 450 440 info = kmalloc(sizeof(*info), GFP_KERNEL); 451 441 if (!info) { 452 - err("%s: Cannot allocate memory\n", __func__); 442 + ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n", 443 + __func__); 453 444 return; 454 445 } 455 446 info->p_slot = p_slot; ··· 497 486 static void handle_button_press_event(struct slot *p_slot) 498 487 { 499 488 u8 getstatus; 489 + struct controller *ctrl = p_slot->ctrl; 500 490 501 491 switch (p_slot->state) { 502 492 case STATIC_STATE: 503 493 p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 504 494 if (getstatus) { 505 495 p_slot->state = BLINKINGOFF_STATE; 506 - info("PCI slot #%s - powering off due to button " 507 - "press.\n", slot_name(p_slot)); 496 + ctrl_info(ctrl, "PCI slot #%s - powering off due to " 497 + "button press.\n", slot_name(p_slot)); 508 498 } else { 509 499 p_slot->state = BLINKINGON_STATE; 510 - info("PCI slot #%s - powering on due to button " 511 - "press.\n", slot_name(p_slot)); 500 + ctrl_info(ctrl, "PCI slot #%s - powering on due to " 501 + "button press.\n", slot_name(p_slot)); 512 502 } 513 503 /* blink green LED and turn off amber */ 514 504 p_slot->hpc_ops->green_led_blink(p_slot); ··· 524 512 * press the attention again before the 5 sec. limit 525 513 * expires to cancel hot-add or hot-remove 526 514 */ 527 - info("Button cancel on Slot(%s)\n", slot_name(p_slot)); 528 - dbg("%s: button cancel\n", __func__); 515 + ctrl_info(ctrl, "Button cancel on Slot(%s)\n", 516 + slot_name(p_slot)); 517 + ctrl_dbg(ctrl, "%s: button cancel\n", __func__); 529 518 cancel_delayed_work(&p_slot->work); 530 519 if (p_slot->state == BLINKINGOFF_STATE) 531 520 p_slot->hpc_ops->green_led_on(p_slot); 532 521 else 533 522 p_slot->hpc_ops->green_led_off(p_slot); 534 523 p_slot->hpc_ops->set_attention_status(p_slot, 0); 535 - info("PCI slot #%s - action canceled due to button press\n", 536 - slot_name(p_slot)); 524 + ctrl_info(ctrl, "PCI slot #%s - action canceled due to " 525 + "button press\n", slot_name(p_slot)); 537 526 p_slot->state = STATIC_STATE; 538 527 break; 539 528 case POWEROFF_STATE: ··· 544 531 * this means that the previous attention button action 545 532 * to hot-add or hot-remove is undergoing 546 533 */ 547 - info("Button ignore on Slot(%s)\n", slot_name(p_slot)); 534 + ctrl_info(ctrl, "Button ignore on Slot(%s)\n", 535 + slot_name(p_slot)); 548 536 update_slot_info(p_slot); 549 537 break; 550 538 default: 551 - warn("Not a valid state\n"); 539 + ctrl_warn(ctrl, "Not a valid state\n"); 552 540 break; 553 541 } 554 542 } ··· 565 551 handle_button_press_event(p_slot); 566 552 break; 567 553 case INT_POWER_FAULT: 568 - dbg("%s: power fault\n", __func__); 554 + ctrl_dbg(p_slot->ctrl, "%s: power fault\n", __func__); 569 555 p_slot->hpc_ops->set_attention_status(p_slot, 1); 570 556 p_slot->hpc_ops->green_led_off(p_slot); 571 557 break; ··· 583 569 { 584 570 u8 getstatus = 0; 585 571 int rc, retval = -ENODEV; 572 + struct controller *ctrl = p_slot->ctrl; 586 573 587 574 /* Check to see if (latch closed, card present, power off) */ 588 575 mutex_lock(&p_slot->ctrl->crit_sect); 589 576 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 590 577 if (rc || !getstatus) { 591 - info("No adapter on slot(%s)\n", slot_name(p_slot)); 578 + ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 592 579 goto out; 593 580 } 594 581 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 595 582 if (rc || getstatus) { 596 - info("Latch open on slot(%s)\n", slot_name(p_slot)); 583 + ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); 597 584 goto out; 598 585 } 599 586 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 600 587 if (rc || getstatus) { 601 - info("Already enabled on slot(%s)\n", slot_name(p_slot)); 588 + ctrl_info(ctrl, "Already enabled on slot(%s)\n", 589 + slot_name(p_slot)); 602 590 goto out; 603 591 } 604 592 ··· 609 593 /* We have to save the presence info for these slots */ 610 594 p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 611 595 p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save)); 612 - dbg("%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); 596 + ctrl_dbg(ctrl, "%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); 613 597 p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 614 598 615 599 if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) || ··· 640 624 { 641 625 u8 getstatus = 0; 642 626 int rc, retval = -ENODEV; 627 + struct controller *ctrl = p_slot->ctrl; 643 628 644 629 if (!p_slot->ctrl) 645 630 return -ENODEV; ··· 650 633 651 634 rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 652 635 if (rc || !getstatus) { 653 - info("No adapter on slot(%s)\n", slot_name(p_slot)); 636 + ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 654 637 goto out; 655 638 } 656 639 rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 657 640 if (rc || getstatus) { 658 - info("Latch open on slot(%s)\n", slot_name(p_slot)); 641 + ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); 659 642 goto out; 660 643 } 661 644 rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 662 645 if (rc || !getstatus) { 663 - info("Already disabled slot(%s)\n", slot_name(p_slot)); 646 + ctrl_info(ctrl, "Already disabled slot(%s)\n", 647 + slot_name(p_slot)); 664 648 goto out; 665 649 } 666 650 ··· 675 657 int shpchp_sysfs_enable_slot(struct slot *p_slot) 676 658 { 677 659 int retval = -ENODEV; 660 + struct controller *ctrl = p_slot->ctrl; 678 661 679 662 mutex_lock(&p_slot->lock); 680 663 switch (p_slot->state) { ··· 689 670 p_slot->state = STATIC_STATE; 690 671 break; 691 672 case POWERON_STATE: 692 - info("Slot %s is already in powering on state\n", 693 - slot_name(p_slot)); 673 + ctrl_info(ctrl, "Slot %s is already in powering on state\n", 674 + slot_name(p_slot)); 694 675 break; 695 676 case BLINKINGOFF_STATE: 696 677 case POWEROFF_STATE: 697 - info("Already enabled on slot %s\n", slot_name(p_slot)); 678 + ctrl_info(ctrl, "Already enabled on slot %s\n", 679 + slot_name(p_slot)); 698 680 break; 699 681 default: 700 - err("Not a valid state on slot %s\n", slot_name(p_slot)); 682 + ctrl_err(ctrl, "Not a valid state on slot %s\n", 683 + slot_name(p_slot)); 701 684 break; 702 685 } 703 686 mutex_unlock(&p_slot->lock); ··· 710 689 int shpchp_sysfs_disable_slot(struct slot *p_slot) 711 690 { 712 691 int retval = -ENODEV; 692 + struct controller *ctrl = p_slot->ctrl; 713 693 714 694 mutex_lock(&p_slot->lock); 715 695 switch (p_slot->state) { ··· 724 702 p_slot->state = STATIC_STATE; 725 703 break; 726 704 case POWEROFF_STATE: 727 - info("Slot %s is already in powering off state\n", 728 - slot_name(p_slot)); 705 + ctrl_info(ctrl, "Slot %s is already in powering off state\n", 706 + slot_name(p_slot)); 729 707 break; 730 708 case BLINKINGON_STATE: 731 709 case POWERON_STATE: 732 - info("Already disabled on slot %s\n", slot_name(p_slot)); 710 + ctrl_info(ctrl, "Already disabled on slot %s\n", 711 + slot_name(p_slot)); 733 712 break; 734 713 default: 735 - err("Not a valid state on slot %s\n", slot_name(p_slot)); 714 + ctrl_err(ctrl, "Not a valid state on slot %s\n", 715 + slot_name(p_slot)); 736 716 break; 737 717 } 738 718 mutex_unlock(&p_slot->lock);
+64 -56
drivers/pci/hotplug/shpchp_hpc.c
··· 300 300 !is_ctrl_busy(ctrl), timeout); 301 301 if (!rc && is_ctrl_busy(ctrl)) { 302 302 retval = -EIO; 303 - err("Command not completed in 1000 msec\n"); 303 + ctrl_err(ctrl, "Command not completed in 1000 msec\n"); 304 304 } else if (rc < 0) { 305 305 retval = -EINTR; 306 - info("Command was interrupted by a signal\n"); 306 + ctrl_info(ctrl, "Command was interrupted by a signal\n"); 307 307 } 308 308 309 309 return retval; ··· 320 320 321 321 if (!shpc_poll_ctrl_busy(ctrl)) { 322 322 /* After 1 sec and and the controller is still busy */ 323 - err("%s : Controller is still busy after 1 sec.\n", 324 - __func__); 323 + ctrl_err(ctrl, "%s : Controller is still busy after 1 sec.\n", 324 + __func__); 325 325 retval = -EBUSY; 326 326 goto out; 327 327 } 328 328 329 329 ++t_slot; 330 330 temp_word = (t_slot << 8) | (cmd & 0xFF); 331 - dbg("%s: t_slot %x cmd %x\n", __func__, t_slot, cmd); 331 + ctrl_dbg(ctrl, "%s: t_slot %x cmd %x\n", __func__, t_slot, cmd); 332 332 333 333 /* To make sure the Controller Busy bit is 0 before we send out the 334 334 * command. ··· 344 344 345 345 cmd_status = hpc_check_cmd_status(slot->ctrl); 346 346 if (cmd_status) { 347 - err("%s: Failed to issued command 0x%x (error code = %d)\n", 348 - __func__, cmd, cmd_status); 347 + ctrl_err(ctrl, "%s: Failed to issued command 0x%x " 348 + "(error code = %d)\n", __func__, cmd, cmd_status); 349 349 retval = -EIO; 350 350 } 351 351 out: ··· 364 364 break; 365 365 case 1: 366 366 retval = SWITCH_OPEN; 367 - err("%s: Switch opened!\n", __func__); 367 + ctrl_err(ctrl, "%s: Switch opened!\n", __func__); 368 368 break; 369 369 case 2: 370 370 retval = INVALID_CMD; 371 - err("%s: Invalid HPC command!\n", __func__); 371 + ctrl_err(ctrl, "%s: Invalid HPC command!\n", __func__); 372 372 break; 373 373 case 4: 374 374 retval = INVALID_SPEED_MODE; 375 - err("%s: Invalid bus speed/mode!\n", __func__); 375 + ctrl_err(ctrl, "%s: Invalid bus speed/mode!\n", __func__); 376 376 break; 377 377 default: 378 378 retval = cmd_status; ··· 483 483 return -ENODEV; 484 484 } 485 485 486 - dbg("%s: slot_reg = %x, pcix_cap = %x, m66_cap = %x\n", 487 - __func__, slot_reg, pcix_cap, m66_cap); 486 + ctrl_dbg(ctrl, "%s: slot_reg = %x, pcix_cap = %x, m66_cap = %x\n", 487 + __func__, slot_reg, pcix_cap, m66_cap); 488 488 489 489 switch (pcix_cap) { 490 490 case 0x0: ··· 509 509 break; 510 510 } 511 511 512 - dbg("Adapter speed = %d\n", *value); 512 + ctrl_dbg(ctrl, "Adapter speed = %d\n", *value); 513 513 return retval; 514 514 } 515 515 ··· 526 526 retval = -1; 527 527 } 528 528 529 - dbg("Mode 1 ECC cap = %d\n", *mode); 529 + ctrl_dbg(ctrl, "Mode 1 ECC cap = %d\n", *mode); 530 530 return retval; 531 531 } 532 532 ··· 629 629 630 630 retval = shpc_write_cmd(slot, slot->hp_slot, SET_SLOT_PWR); 631 631 if (retval) 632 - err("%s: Write command failed!\n", __func__); 632 + ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); 633 633 634 634 return retval; 635 635 } ··· 642 642 retval = shpc_write_cmd(slot, slot->hp_slot, 643 643 SET_SLOT_ENABLE | SET_PWR_BLINK | SET_ATTN_OFF); 644 644 if (retval) 645 - err("%s: Write command failed!\n", __func__); 645 + ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); 646 646 647 647 return retval; 648 648 } ··· 655 655 retval = shpc_write_cmd(slot, slot->hp_slot, 656 656 SET_SLOT_DISABLE | SET_PWR_OFF | SET_ATTN_ON); 657 657 if (retval) 658 - err("%s: Write command failed!\n", __func__); 658 + ctrl_err(slot->ctrl, "%s: Write command failed!\n", __func__); 659 659 660 660 return retval; 661 661 } ··· 719 719 720 720 retval = shpc_write_cmd(slot, 0, cmd); 721 721 if (retval) 722 - err("%s: Write command failed!\n", __func__); 722 + ctrl_err(ctrl, "%s: Write command failed!\n", __func__); 723 723 724 724 return retval; 725 725 } ··· 735 735 if (!intr_loc) 736 736 return IRQ_NONE; 737 737 738 - dbg("%s: intr_loc = %x\n",__func__, intr_loc); 738 + ctrl_dbg(ctrl, "%s: intr_loc = %x\n", __func__, intr_loc); 739 739 740 740 if(!shpchp_poll_mode) { 741 741 /* ··· 748 748 shpc_writel(ctrl, SERR_INTR_ENABLE, serr_int); 749 749 750 750 intr_loc2 = shpc_readl(ctrl, INTR_LOC); 751 - dbg("%s: intr_loc2 = %x\n",__func__, intr_loc2); 751 + ctrl_dbg(ctrl, "%s: intr_loc2 = %x\n", __func__, intr_loc2); 752 752 } 753 753 754 754 if (intr_loc & CMD_INTR_PENDING) { ··· 773 773 continue; 774 774 775 775 slot_reg = shpc_readl(ctrl, SLOT_REG(hp_slot)); 776 - dbg("%s: Slot %x with intr, slot register = %x\n", 777 - __func__, hp_slot, slot_reg); 776 + ctrl_dbg(ctrl, "%s: Slot %x with intr, slot register = %x\n", 777 + __func__, hp_slot, slot_reg); 778 778 779 779 if (slot_reg & MRL_CHANGE_DETECTED) 780 780 shpchp_handle_switch_change(hp_slot, ctrl); ··· 843 843 } 844 844 845 845 *value = bus_speed; 846 - dbg("Max bus speed = %d\n", bus_speed); 846 + ctrl_dbg(ctrl, "Max bus speed = %d\n", bus_speed); 847 847 848 848 return retval; 849 849 } ··· 911 911 break; 912 912 } 913 913 914 - dbg("Current bus speed = %d\n", bus_speed); 914 + ctrl_dbg(ctrl, "Current bus speed = %d\n", bus_speed); 915 915 return retval; 916 916 } 917 917 ··· 958 958 } else { 959 959 ctrl->cap_offset = pci_find_capability(pdev, PCI_CAP_ID_SHPC); 960 960 if (!ctrl->cap_offset) { 961 - err("%s : cap_offset == 0\n", __func__); 961 + ctrl_err(ctrl, "%s : cap_offset == 0\n", __func__); 962 962 goto abort; 963 963 } 964 - dbg("%s: cap_offset = %x\n", __func__, ctrl->cap_offset); 964 + ctrl_dbg(ctrl, "%s: cap_offset = %x\n", __func__, 965 + ctrl->cap_offset); 965 966 966 967 rc = shpc_indirect_read(ctrl, 0, &shpc_base_offset); 967 968 if (rc) { 968 - err("%s: cannot read base_offset\n", __func__); 969 + ctrl_err(ctrl, "%s: cannot read base_offset\n", 970 + __func__); 969 971 goto abort; 970 972 } 971 973 972 974 rc = shpc_indirect_read(ctrl, 3, &tempdword); 973 975 if (rc) { 974 - err("%s: cannot read slot config\n", __func__); 976 + ctrl_err(ctrl, "%s: cannot read slot config\n", 977 + __func__); 975 978 goto abort; 976 979 } 977 980 num_slots = tempdword & SLOT_NUM; 978 - dbg("%s: num_slots (indirect) %x\n", __func__, num_slots); 981 + ctrl_dbg(ctrl, "%s: num_slots (indirect) %x\n", 982 + __func__, num_slots); 979 983 980 984 for (i = 0; i < 9 + num_slots; i++) { 981 985 rc = shpc_indirect_read(ctrl, i, &tempdword); 982 986 if (rc) { 983 - err("%s: cannot read creg (index = %d)\n", 984 - __func__, i); 987 + ctrl_err(ctrl, "%s: cannot read creg " 988 + "(index = %d)\n", __func__, i); 985 989 goto abort; 986 990 } 987 - dbg("%s: offset %d: value %x\n", __func__,i, 988 - tempdword); 991 + ctrl_dbg(ctrl, "%s: offset %d: value %x\n", 992 + __func__, i, tempdword); 989 993 } 990 994 991 995 ctrl->mmio_base = ··· 997 993 ctrl->mmio_size = 0x24 + 0x4 * num_slots; 998 994 } 999 995 1000 - info("HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", pdev->vendor, pdev->device, pdev->subsystem_vendor, 1001 - pdev->subsystem_device); 996 + ctrl_info(ctrl, "HPC vendor_id %x device_id %x ss_vid %x ss_did %x\n", 997 + pdev->vendor, pdev->device, pdev->subsystem_vendor, 998 + pdev->subsystem_device); 1002 999 1003 1000 rc = pci_enable_device(pdev); 1004 1001 if (rc) { 1005 - err("%s: pci_enable_device failed\n", __func__); 1002 + ctrl_err(ctrl, "%s: pci_enable_device failed\n", __func__); 1006 1003 goto abort; 1007 1004 } 1008 1005 1009 1006 if (!request_mem_region(ctrl->mmio_base, ctrl->mmio_size, MY_NAME)) { 1010 - err("%s: cannot reserve MMIO region\n", __func__); 1007 + ctrl_err(ctrl, "%s: cannot reserve MMIO region\n", __func__); 1011 1008 rc = -1; 1012 1009 goto abort; 1013 1010 } 1014 1011 1015 1012 ctrl->creg = ioremap(ctrl->mmio_base, ctrl->mmio_size); 1016 1013 if (!ctrl->creg) { 1017 - err("%s: cannot remap MMIO region %lx @ %lx\n", __func__, 1018 - ctrl->mmio_size, ctrl->mmio_base); 1014 + ctrl_err(ctrl, "%s: cannot remap MMIO region %lx @ %lx\n", 1015 + __func__, ctrl->mmio_size, ctrl->mmio_base); 1019 1016 release_mem_region(ctrl->mmio_base, ctrl->mmio_size); 1020 1017 rc = -1; 1021 1018 goto abort; 1022 1019 } 1023 - dbg("%s: ctrl->creg %p\n", __func__, ctrl->creg); 1020 + ctrl_dbg(ctrl, "%s: ctrl->creg %p\n", __func__, ctrl->creg); 1024 1021 1025 1022 mutex_init(&ctrl->crit_sect); 1026 1023 mutex_init(&ctrl->cmd_lock); ··· 1040 1035 1041 1036 /* Mask Global Interrupt Mask & Command Complete Interrupt Mask */ 1042 1037 tempdword = shpc_readl(ctrl, SERR_INTR_ENABLE); 1043 - dbg("%s: SERR_INTR_ENABLE = %x\n", __func__, tempdword); 1038 + ctrl_dbg(ctrl, "%s: SERR_INTR_ENABLE = %x\n", __func__, tempdword); 1044 1039 tempdword |= (GLOBAL_INTR_MASK | GLOBAL_SERR_MASK | 1045 1040 COMMAND_INTR_MASK | ARBITER_SERR_MASK); 1046 1041 tempdword &= ~SERR_INTR_RSVDZ_MASK; 1047 1042 shpc_writel(ctrl, SERR_INTR_ENABLE, tempdword); 1048 1043 tempdword = shpc_readl(ctrl, SERR_INTR_ENABLE); 1049 - dbg("%s: SERR_INTR_ENABLE = %x\n", __func__, tempdword); 1044 + ctrl_dbg(ctrl, "%s: SERR_INTR_ENABLE = %x\n", __func__, tempdword); 1050 1045 1051 1046 /* Mask the MRL sensor SERR Mask of individual slot in 1052 1047 * Slot SERR-INT Mask & clear all the existing event if any 1053 1048 */ 1054 1049 for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { 1055 1050 slot_reg = shpc_readl(ctrl, SLOT_REG(hp_slot)); 1056 - dbg("%s: Default Logical Slot Register %d value %x\n", __func__, 1057 - hp_slot, slot_reg); 1051 + ctrl_dbg(ctrl, "%s: Default Logical Slot Register %d " 1052 + "value %x\n", __func__, hp_slot, slot_reg); 1058 1053 slot_reg |= (PRSNT_CHANGE_INTR_MASK | ISO_PFAULT_INTR_MASK | 1059 1054 BUTTON_PRESS_INTR_MASK | MRL_CHANGE_INTR_MASK | 1060 1055 CON_PFAULT_INTR_MASK | MRL_CHANGE_SERR_MASK | ··· 1071 1066 /* Installs the interrupt handler */ 1072 1067 rc = pci_enable_msi(pdev); 1073 1068 if (rc) { 1074 - info("Can't get msi for the hotplug controller\n"); 1075 - info("Use INTx for the hotplug controller\n"); 1069 + ctrl_info(ctrl, 1070 + "Can't get msi for the hotplug controller\n"); 1071 + ctrl_info(ctrl, 1072 + "Use INTx for the hotplug controller\n"); 1076 1073 } 1077 1074 1078 1075 rc = request_irq(ctrl->pci_dev->irq, shpc_isr, IRQF_SHARED, 1079 1076 MY_NAME, (void *)ctrl); 1080 - dbg("%s: request_irq %d for hpc%d (returns %d)\n", 1081 - __func__, ctrl->pci_dev->irq, 1077 + ctrl_dbg(ctrl, "%s: request_irq %d for hpc%d (returns %d)\n", 1078 + __func__, ctrl->pci_dev->irq, 1082 1079 atomic_read(&shpchp_num_controllers), rc); 1083 1080 if (rc) { 1084 - err("Can't get irq %d for the hotplug controller\n", 1085 - ctrl->pci_dev->irq); 1081 + ctrl_err(ctrl, "Can't get irq %d for the hotplug " 1082 + "controller\n", ctrl->pci_dev->irq); 1086 1083 goto abort_iounmap; 1087 1084 } 1088 1085 } 1089 - dbg("%s: HPC at b:d:f:irq=0x%x:%x:%x:%x\n", __func__, 1090 - pdev->bus->number, PCI_SLOT(pdev->devfn), 1091 - PCI_FUNC(pdev->devfn), pdev->irq); 1086 + ctrl_dbg(ctrl, "%s: HPC at b:d:f:irq=0x%x:%x:%x:%x\n", 1087 + __func__, pdev->bus->number, PCI_SLOT(pdev->devfn), 1088 + PCI_FUNC(pdev->devfn), pdev->irq); 1092 1089 1093 1090 /* 1094 1091 * If this is the first controller to be initialized, ··· 1109 1102 */ 1110 1103 for (hp_slot = 0; hp_slot < ctrl->num_slots; hp_slot++) { 1111 1104 slot_reg = shpc_readl(ctrl, SLOT_REG(hp_slot)); 1112 - dbg("%s: Default Logical Slot Register %d value %x\n", __func__, 1113 - hp_slot, slot_reg); 1105 + ctrl_dbg(ctrl, "%s: Default Logical Slot Register %d " 1106 + "value %x\n", __func__, hp_slot, slot_reg); 1114 1107 slot_reg &= ~(PRSNT_CHANGE_INTR_MASK | ISO_PFAULT_INTR_MASK | 1115 1108 BUTTON_PRESS_INTR_MASK | MRL_CHANGE_INTR_MASK | 1116 1109 CON_PFAULT_INTR_MASK | SLOT_REG_RSVDZ_MASK); ··· 1123 1116 SERR_INTR_RSVDZ_MASK); 1124 1117 shpc_writel(ctrl, SERR_INTR_ENABLE, tempdword); 1125 1118 tempdword = shpc_readl(ctrl, SERR_INTR_ENABLE); 1126 - dbg("%s: SERR_INTR_ENABLE = %x\n", __func__, tempdword); 1119 + ctrl_dbg(ctrl, "%s: SERR_INTR_ENABLE = %x\n", 1120 + __func__, tempdword); 1127 1121 } 1128 1122 1129 1123 return 0;
+19 -13
drivers/pci/hotplug/shpchp_pci.c
··· 101 101 struct pci_dev *dev; 102 102 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 103 103 int num, fn; 104 + struct controller *ctrl = p_slot->ctrl; 104 105 105 106 dev = pci_get_slot(parent, PCI_DEVFN(p_slot->device, 0)); 106 107 if (dev) { 107 - err("Device %s already exists at %x:%x, cannot hot-add\n", 108 - pci_name(dev), p_slot->bus, p_slot->device); 108 + ctrl_err(ctrl, 109 + "Device %s already exists at %x:%x, cannot hot-add\n", 110 + pci_name(dev), p_slot->bus, p_slot->device); 109 111 pci_dev_put(dev); 110 112 return -EINVAL; 111 113 } 112 114 113 115 num = pci_scan_slot(parent, PCI_DEVFN(p_slot->device, 0)); 114 116 if (num == 0) { 115 - err("No new device found\n"); 117 + ctrl_err(ctrl, "No new device found\n"); 116 118 return -ENODEV; 117 119 } 118 120 ··· 123 121 if (!dev) 124 122 continue; 125 123 if ((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 126 - err("Cannot hot-add display device %s\n", 127 - pci_name(dev)); 124 + ctrl_err(ctrl, "Cannot hot-add display device %s\n", 125 + pci_name(dev)); 128 126 pci_dev_put(dev); 129 127 continue; 130 128 } ··· 140 138 break; 141 139 } 142 140 if (busnr >= end) { 143 - err("No free bus for hot-added bridge\n"); 141 + ctrl_err(ctrl, 142 + "No free bus for hot-added bridge\n"); 144 143 pci_dev_put(dev); 145 144 continue; 146 145 } 147 146 child = pci_add_new_bus(parent, dev, busnr); 148 147 if (!child) { 149 - err("Cannot add new bus for %s\n", 150 - pci_name(dev)); 148 + ctrl_err(ctrl, "Cannot add new bus for %s\n", 149 + pci_name(dev)); 151 150 pci_dev_put(dev); 152 151 continue; 153 152 } ··· 171 168 int j; 172 169 u8 bctl = 0; 173 170 struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; 171 + struct controller *ctrl = p_slot->ctrl; 174 172 175 - dbg("%s: bus/dev = %x/%x\n", __func__, p_slot->bus, p_slot->device); 173 + ctrl_dbg(ctrl, "%s: bus/dev = %x/%x\n", 174 + __func__, p_slot->bus, p_slot->device); 176 175 177 176 for (j=0; j<8 ; j++) { 178 177 struct pci_dev* temp = pci_get_slot(parent, ··· 182 177 if (!temp) 183 178 continue; 184 179 if ((temp->class >> 16) == PCI_BASE_CLASS_DISPLAY) { 185 - err("Cannot remove display device %s\n", 186 - pci_name(temp)); 180 + ctrl_err(ctrl, "Cannot remove display device %s\n", 181 + pci_name(temp)); 187 182 pci_dev_put(temp); 188 183 continue; 189 184 } 190 185 if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { 191 186 pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); 192 187 if (bctl & PCI_BRIDGE_CTL_VGA) { 193 - err("Cannot remove display device %s\n", 194 - pci_name(temp)); 188 + ctrl_err(ctrl, 189 + "Cannot remove display device %s\n", 190 + pci_name(temp)); 195 191 pci_dev_put(temp); 196 192 continue; 197 193 }