.. | .. |
---|
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> |
---|
.. | .. |
---|
187 | 189 | (kcs->error_retries)++; |
---|
188 | 190 | if (kcs->error_retries > MAX_ERROR_RETRIES) { |
---|
189 | 191 | if (kcs_debug & KCS_DEBUG_ENABLE) |
---|
190 | | - printk(KERN_DEBUG "ipmi_kcs_sm: kcs hosed: %s\n", |
---|
191 | | - reason); |
---|
| 192 | + dev_dbg(kcs->io->dev, "ipmi_kcs_sm: kcs hosed: %s\n", |
---|
| 193 | + reason); |
---|
192 | 194 | kcs->state = KCS_HOSED; |
---|
193 | 195 | } else { |
---|
194 | 196 | kcs->error0_timeout = jiffies + ERROR0_OBF_WAIT_JIFFIES; |
---|
.. | .. |
---|
268 | 270 | if (size > MAX_KCS_WRITE_SIZE) |
---|
269 | 271 | return IPMI_REQ_LEN_EXCEEDED_ERR; |
---|
270 | 272 | |
---|
271 | | - if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) |
---|
| 273 | + if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) { |
---|
| 274 | + dev_warn(kcs->io->dev, "KCS in invalid state %d\n", kcs->state); |
---|
272 | 275 | return IPMI_NOT_IN_MY_STATE_ERR; |
---|
| 276 | + } |
---|
273 | 277 | |
---|
274 | 278 | if (kcs_debug & KCS_DEBUG_MSG) { |
---|
275 | | - printk(KERN_DEBUG "start_kcs_transaction -"); |
---|
| 279 | + dev_dbg(kcs->io->dev, "%s -", __func__); |
---|
276 | 280 | for (i = 0; i < size; i++) |
---|
277 | | - printk(" %02x", (unsigned char) (data [i])); |
---|
278 | | - printk("\n"); |
---|
| 281 | + pr_cont(" %02x", data[i]); |
---|
| 282 | + pr_cont("\n"); |
---|
279 | 283 | } |
---|
280 | 284 | kcs->error_retries = 0; |
---|
281 | 285 | memcpy(kcs->write_data, data, size); |
---|
.. | .. |
---|
331 | 335 | status = read_status(kcs); |
---|
332 | 336 | |
---|
333 | 337 | if (kcs_debug & KCS_DEBUG_STATES) |
---|
334 | | - printk(KERN_DEBUG "KCS: State = %d, %x\n", kcs->state, status); |
---|
| 338 | + dev_dbg(kcs->io->dev, |
---|
| 339 | + "KCS: State = %d, %x\n", kcs->state, status); |
---|
335 | 340 | |
---|
336 | 341 | /* All states wait for ibf, so just do it here. */ |
---|
337 | 342 | if (!check_ibf(kcs, status, time)) |
---|