Commit a190db94 authored by Corey Minyard's avatar Corey Minyard

ipmi: Clean up some printks

Convert to dev_xxx() and fix some verbage.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent f8910ffa
...@@ -214,7 +214,7 @@ static int bt_start_transaction(struct si_sm_data *bt, ...@@ -214,7 +214,7 @@ static int bt_start_transaction(struct si_sm_data *bt,
return IPMI_NODE_BUSY_ERR; return IPMI_NODE_BUSY_ERR;
if (bt->state != BT_STATE_IDLE) { if (bt->state != BT_STATE_IDLE) {
dev_warn(bt->io->dev, "BT is now in the state %d\n", bt->state); dev_warn(bt->io->dev, "BT in invalid state %d\n", bt->state);
return IPMI_NOT_IN_MY_STATE_ERR; return IPMI_NOT_IN_MY_STATE_ERR;
} }
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* that document. * that document.
*/ */
#define DEBUG /* So dev_dbg() is always available. */
#include <linux/kernel.h> /* For printk. */ #include <linux/kernel.h> /* For printk. */
#include <linux/module.h> #include <linux/module.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
...@@ -187,7 +189,7 @@ static inline void start_error_recovery(struct si_sm_data *kcs, char *reason) ...@@ -187,7 +189,7 @@ static inline void start_error_recovery(struct si_sm_data *kcs, char *reason)
(kcs->error_retries)++; (kcs->error_retries)++;
if (kcs->error_retries > MAX_ERROR_RETRIES) { if (kcs->error_retries > MAX_ERROR_RETRIES) {
if (kcs_debug & KCS_DEBUG_ENABLE) if (kcs_debug & KCS_DEBUG_ENABLE)
printk(KERN_DEBUG "ipmi_kcs_sm: kcs hosed: %s\n", dev_dbg(kcs->io->dev, "ipmi_kcs_sm: kcs hosed: %s\n",
reason); reason);
kcs->state = KCS_HOSED; kcs->state = KCS_HOSED;
} else { } else {
...@@ -269,12 +271,12 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data, ...@@ -269,12 +271,12 @@ static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data,
return IPMI_REQ_LEN_EXCEEDED_ERR; return IPMI_REQ_LEN_EXCEEDED_ERR;
if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) { if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) {
pr_warn("KCS is now in the state %d\n", kcs->state); dev_warn(kcs->io->dev, "KCS in invalid state %d\n", kcs->state);
return IPMI_NOT_IN_MY_STATE_ERR; return IPMI_NOT_IN_MY_STATE_ERR;
} }
if (kcs_debug & KCS_DEBUG_MSG) { if (kcs_debug & KCS_DEBUG_MSG) {
printk(KERN_DEBUG "start_kcs_transaction -"); dev_dbg(kcs->io->dev, "%s -", __func__);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
pr_cont(" %02x", data[i]); pr_cont(" %02x", data[i]);
pr_cont("\n"); pr_cont("\n");
...@@ -333,7 +335,8 @@ static enum si_sm_result kcs_event(struct si_sm_data *kcs, long time) ...@@ -333,7 +335,8 @@ static enum si_sm_result kcs_event(struct si_sm_data *kcs, long time)
status = read_status(kcs); status = read_status(kcs);
if (kcs_debug & KCS_DEBUG_STATES) if (kcs_debug & KCS_DEBUG_STATES)
printk(KERN_DEBUG "KCS: State = %d, %x\n", kcs->state, status); dev_dbg(kcs->io->dev,
"KCS: State = %d, %x\n", kcs->state, status);
/* All states wait for ibf, so just do it here. */ /* All states wait for ibf, so just do it here. */
if (!check_ibf(kcs, status, time)) if (!check_ibf(kcs, status, time))
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
* 2001 Hewlett-Packard Company * 2001 Hewlett-Packard Company
*/ */
#define DEBUG /* So dev_dbg() is always available. */
#include <linux/kernel.h> /* For printk. */ #include <linux/kernel.h> /* For printk. */
#include <linux/string.h> #include <linux/string.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -127,12 +129,13 @@ static int start_smic_transaction(struct si_sm_data *smic, ...@@ -127,12 +129,13 @@ static int start_smic_transaction(struct si_sm_data *smic,
return IPMI_REQ_LEN_EXCEEDED_ERR; return IPMI_REQ_LEN_EXCEEDED_ERR;
if ((smic->state != SMIC_IDLE) && (smic->state != SMIC_HOSED)) { if ((smic->state != SMIC_IDLE) && (smic->state != SMIC_HOSED)) {
pr_warn("SMIC is now in the state %d\n", smic->state); dev_warn(smic->io->dev,
"SMIC in invalid state %d\n", smic->state);
return IPMI_NOT_IN_MY_STATE_ERR; return IPMI_NOT_IN_MY_STATE_ERR;
} }
if (smic_debug & SMIC_DEBUG_MSG) { if (smic_debug & SMIC_DEBUG_MSG) {
printk(KERN_DEBUG "start_smic_transaction -"); dev_dbg(smic->io->dev, "%s -", __func__);
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
pr_cont(" %02x", data[i]); pr_cont(" %02x", data[i]);
pr_cont("\n"); pr_cont("\n");
...@@ -154,7 +157,7 @@ static int smic_get_result(struct si_sm_data *smic, ...@@ -154,7 +157,7 @@ static int smic_get_result(struct si_sm_data *smic,
int i; int i;
if (smic_debug & SMIC_DEBUG_MSG) { if (smic_debug & SMIC_DEBUG_MSG) {
printk(KERN_DEBUG "smic_get result -"); dev_dbg(smic->io->dev, "smic_get result -");
for (i = 0; i < smic->read_pos; i++) for (i = 0; i < smic->read_pos; i++)
pr_cont(" %02x", smic->read_data[i]); pr_cont(" %02x", smic->read_data[i]);
pr_cont("\n"); pr_cont("\n");
...@@ -326,9 +329,9 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time) ...@@ -326,9 +329,9 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time)
} }
if (smic->state != SMIC_IDLE) { if (smic->state != SMIC_IDLE) {
if (smic_debug & SMIC_DEBUG_STATES) if (smic_debug & SMIC_DEBUG_STATES)
printk(KERN_DEBUG dev_dbg(smic->io->dev,
"smic_event - smic->smic_timeout = %ld, time = %ld\n", "%s - smic->smic_timeout = %ld, time = %ld\n",
smic->smic_timeout, time); __func__, smic->smic_timeout, time);
/* /*
* FIXME: smic_event is sometimes called with time > * FIXME: smic_event is sometimes called with time >
* SMIC_RETRY_TIMEOUT * SMIC_RETRY_TIMEOUT
...@@ -347,8 +350,9 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time) ...@@ -347,8 +350,9 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time)
status = read_smic_status(smic); status = read_smic_status(smic);
if (smic_debug & SMIC_DEBUG_STATES) if (smic_debug & SMIC_DEBUG_STATES)
printk(KERN_DEBUG "smic_event - state = %d, flags = 0x%02x, status = 0x%02x\n", dev_dbg(smic->io->dev,
smic->state, flags, status); "%s - state = %d, flags = 0x%02x, status = 0x%02x\n",
__func__, smic->state, flags, status);
switch (smic->state) { switch (smic->state) {
case SMIC_IDLE: case SMIC_IDLE:
...@@ -438,7 +442,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time) ...@@ -438,7 +442,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time)
data = read_smic_data(smic); data = read_smic_data(smic);
if (data != 0) { if (data != 0) {
if (smic_debug & SMIC_DEBUG_ENABLE) if (smic_debug & SMIC_DEBUG_ENABLE)
printk(KERN_DEBUG "SMIC_WRITE_END: data = %02x\n", dev_dbg(smic->io->dev,
"SMIC_WRITE_END: data = %02x\n",
data); data);
start_error_recovery(smic, start_error_recovery(smic,
"state = SMIC_WRITE_END, " "state = SMIC_WRITE_END, "
...@@ -518,7 +523,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time) ...@@ -518,7 +523,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time)
/* data register holds an error code */ /* data register holds an error code */
if (data != 0) { if (data != 0) {
if (smic_debug & SMIC_DEBUG_ENABLE) if (smic_debug & SMIC_DEBUG_ENABLE)
printk(KERN_DEBUG "SMIC_READ_END: data = %02x\n", dev_dbg(smic->io->dev,
"SMIC_READ_END: data = %02x\n",
data); data);
start_error_recovery(smic, start_error_recovery(smic,
"state = SMIC_READ_END, " "state = SMIC_READ_END, "
...@@ -535,7 +541,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time) ...@@ -535,7 +541,8 @@ static enum si_sm_result smic_event(struct si_sm_data *smic, long time)
default: default:
if (smic_debug & SMIC_DEBUG_ENABLE) { if (smic_debug & SMIC_DEBUG_ENABLE) {
printk(KERN_DEBUG "smic->state = %d\n", smic->state); dev_dbg(smic->io->dev,
"smic->state = %d\n", smic->state);
start_error_recovery(smic, "state = UNKNOWN"); start_error_recovery(smic, "state = UNKNOWN");
return SI_SM_CALL_WITH_DELAY; return SI_SM_CALL_WITH_DELAY;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment