Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipmi: Clean up some printks

Convert to dev_xxx() and fix some verbage.

Signed-off-by: Corey Minyard <cminyard@mvista.com>

+29 -19
+1 -1
drivers/char/ipmi/ipmi_bt_sm.c
··· 214 214 return IPMI_NODE_BUSY_ERR; 215 215 216 216 if (bt->state != BT_STATE_IDLE) { 217 - dev_warn(bt->io->dev, "BT is now in the state %d\n", bt->state); 217 + dev_warn(bt->io->dev, "BT in invalid state %d\n", bt->state); 218 218 return IPMI_NOT_IN_MY_STATE_ERR; 219 219 } 220 220
+8 -5
drivers/char/ipmi/ipmi_kcs_sm.c
··· 17 17 * that document. 18 18 */ 19 19 20 + #define DEBUG /* So dev_dbg() is always available. */ 21 + 20 22 #include <linux/kernel.h> /* For printk. */ 21 23 #include <linux/module.h> 22 24 #include <linux/moduleparam.h> ··· 189 187 (kcs->error_retries)++; 190 188 if (kcs->error_retries > MAX_ERROR_RETRIES) { 191 189 if (kcs_debug & KCS_DEBUG_ENABLE) 192 - printk(KERN_DEBUG "ipmi_kcs_sm: kcs hosed: %s\n", 193 - reason); 190 + dev_dbg(kcs->io->dev, "ipmi_kcs_sm: kcs hosed: %s\n", 191 + reason); 194 192 kcs->state = KCS_HOSED; 195 193 } else { 196 194 kcs->error0_timeout = jiffies + ERROR0_OBF_WAIT_JIFFIES; ··· 271 269 return IPMI_REQ_LEN_EXCEEDED_ERR; 272 270 273 271 if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) { 274 - pr_warn("KCS is now in the state %d\n", kcs->state); 272 + dev_warn(kcs->io->dev, "KCS in invalid state %d\n", kcs->state); 275 273 return IPMI_NOT_IN_MY_STATE_ERR; 276 274 } 277 275 278 276 if (kcs_debug & KCS_DEBUG_MSG) { 279 - printk(KERN_DEBUG "start_kcs_transaction -"); 277 + dev_dbg(kcs->io->dev, "%s -", __func__); 280 278 for (i = 0; i < size; i++) 281 279 pr_cont(" %02x", data[i]); 282 280 pr_cont("\n"); ··· 335 333 status = read_status(kcs); 336 334 337 335 if (kcs_debug & KCS_DEBUG_STATES) 338 - printk(KERN_DEBUG "KCS: State = %d, %x\n", kcs->state, status); 336 + dev_dbg(kcs->io->dev, 337 + "KCS: State = %d, %x\n", kcs->state, status); 339 338 340 339 /* All states wait for ibf, so just do it here. */ 341 340 if (!check_ibf(kcs, status, time))
+20 -13
drivers/char/ipmi/ipmi_smic_sm.c
··· 21 21 * 2001 Hewlett-Packard Company 22 22 */ 23 23 24 + #define DEBUG /* So dev_dbg() is always available. */ 25 + 24 26 #include <linux/kernel.h> /* For printk. */ 25 27 #include <linux/string.h> 26 28 #include <linux/module.h> ··· 129 127 return IPMI_REQ_LEN_EXCEEDED_ERR; 130 128 131 129 if ((smic->state != SMIC_IDLE) && (smic->state != SMIC_HOSED)) { 132 - pr_warn("SMIC is now in the state %d\n", smic->state); 130 + dev_warn(smic->io->dev, 131 + "SMIC in invalid state %d\n", smic->state); 133 132 return IPMI_NOT_IN_MY_STATE_ERR; 134 133 } 135 134 136 135 if (smic_debug & SMIC_DEBUG_MSG) { 137 - printk(KERN_DEBUG "start_smic_transaction -"); 136 + dev_dbg(smic->io->dev, "%s -", __func__); 138 137 for (i = 0; i < size; i++) 139 138 pr_cont(" %02x", data[i]); 140 139 pr_cont("\n"); ··· 157 154 int i; 158 155 159 156 if (smic_debug & SMIC_DEBUG_MSG) { 160 - printk(KERN_DEBUG "smic_get result -"); 157 + dev_dbg(smic->io->dev, "smic_get result -"); 161 158 for (i = 0; i < smic->read_pos; i++) 162 159 pr_cont(" %02x", smic->read_data[i]); 163 160 pr_cont("\n"); ··· 329 326 } 330 327 if (smic->state != SMIC_IDLE) { 331 328 if (smic_debug & SMIC_DEBUG_STATES) 332 - printk(KERN_DEBUG 333 - "smic_event - smic->smic_timeout = %ld, time = %ld\n", 334 - smic->smic_timeout, time); 329 + dev_dbg(smic->io->dev, 330 + "%s - smic->smic_timeout = %ld, time = %ld\n", 331 + __func__, smic->smic_timeout, time); 335 332 /* 336 333 * FIXME: smic_event is sometimes called with time > 337 334 * SMIC_RETRY_TIMEOUT ··· 350 347 351 348 status = read_smic_status(smic); 352 349 if (smic_debug & SMIC_DEBUG_STATES) 353 - printk(KERN_DEBUG "smic_event - state = %d, flags = 0x%02x, status = 0x%02x\n", 354 - smic->state, flags, status); 350 + dev_dbg(smic->io->dev, 351 + "%s - state = %d, flags = 0x%02x, status = 0x%02x\n", 352 + __func__, smic->state, flags, status); 355 353 356 354 switch (smic->state) { 357 355 case SMIC_IDLE: ··· 442 438 data = read_smic_data(smic); 443 439 if (data != 0) { 444 440 if (smic_debug & SMIC_DEBUG_ENABLE) 445 - printk(KERN_DEBUG "SMIC_WRITE_END: data = %02x\n", 446 - data); 441 + dev_dbg(smic->io->dev, 442 + "SMIC_WRITE_END: data = %02x\n", 443 + data); 447 444 start_error_recovery(smic, 448 445 "state = SMIC_WRITE_END, " 449 446 "data != SUCCESS"); ··· 523 518 /* data register holds an error code */ 524 519 if (data != 0) { 525 520 if (smic_debug & SMIC_DEBUG_ENABLE) 526 - printk(KERN_DEBUG "SMIC_READ_END: data = %02x\n", 527 - data); 521 + dev_dbg(smic->io->dev, 522 + "SMIC_READ_END: data = %02x\n", 523 + data); 528 524 start_error_recovery(smic, 529 525 "state = SMIC_READ_END, " 530 526 "data != SUCCESS"); ··· 541 535 542 536 default: 543 537 if (smic_debug & SMIC_DEBUG_ENABLE) { 544 - printk(KERN_DEBUG "smic->state = %d\n", smic->state); 538 + dev_dbg(smic->io->dev, 539 + "smic->state = %d\n", smic->state); 545 540 start_error_recovery(smic, "state = UNKNOWN"); 546 541 return SI_SM_CALL_WITH_DELAY; 547 542 }