提交 64d21720 编写于 作者: S Stefan Richter

firewire: ohci: use dev_printk API

All messages are uniformly prefixed by driver name and device name now.
Signed-off-by: NStefan Richter <stefanr@s5r6.in-berlin.de>
上级 21076226
...@@ -345,7 +345,7 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0" ...@@ -345,7 +345,7 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS)
", or a combination, or all = -1)"); ", or a combination, or all = -1)");
static void log_irqs(u32 evt) static void log_irqs(struct fw_ohci *ohci, u32 evt)
{ {
if (likely(!(param_debug & if (likely(!(param_debug &
(OHCI_PARAM_DEBUG_IRQS | OHCI_PARAM_DEBUG_BUSRESETS)))) (OHCI_PARAM_DEBUG_IRQS | OHCI_PARAM_DEBUG_BUSRESETS))))
...@@ -355,7 +355,8 @@ static void log_irqs(u32 evt) ...@@ -355,7 +355,8 @@ static void log_irqs(u32 evt)
!(evt & OHCI1394_busReset)) !(evt & OHCI1394_busReset))
return; return;
fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, dev_notice(ohci->card.device,
"IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt,
evt & OHCI1394_selfIDComplete ? " selfID" : "", evt & OHCI1394_selfIDComplete ? " selfID" : "",
evt & OHCI1394_RQPkt ? " AR_req" : "", evt & OHCI1394_RQPkt ? " AR_req" : "",
evt & OHCI1394_RSPkt ? " AR_resp" : "", evt & OHCI1394_RSPkt ? " AR_resp" : "",
...@@ -394,24 +395,29 @@ static char _p(u32 *s, int shift) ...@@ -394,24 +395,29 @@ static char _p(u32 *s, int shift)
return port[*s >> shift & 3]; return port[*s >> shift & 3];
} }
static void log_selfids(int node_id, int generation, int self_id_count, u32 *s) static void log_selfids(struct fw_ohci *ohci, int generation, int self_id_count)
{ {
u32 *s;
if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS)))
return; return;
fw_notify("%d selfIDs, generation %d, local node ID %04x\n", dev_notice(ohci->card.device,
self_id_count, generation, node_id); "%d selfIDs, generation %d, local node ID %04x\n",
self_id_count, generation, ohci->node_id);
for (; self_id_count--; ++s) for (s = ohci->self_id_buffer; self_id_count--; ++s)
if ((*s & 1 << 23) == 0) if ((*s & 1 << 23) == 0)
fw_notify("selfID 0: %08x, phy %d [%c%c%c] " dev_notice(ohci->card.device,
"selfID 0: %08x, phy %d [%c%c%c] "
"%s gc=%d %s %s%s%s\n", "%s gc=%d %s %s%s%s\n",
*s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2),
speed[*s >> 14 & 3], *s >> 16 & 63, speed[*s >> 14 & 3], *s >> 16 & 63,
power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "",
*s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : "");
else else
fw_notify("selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n", dev_notice(ohci->card.device,
"selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n",
*s, *s >> 24 & 63, *s, *s >> 24 & 63,
_p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10),
_p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2)); _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2));
...@@ -447,7 +453,8 @@ static const char *tcodes[] = { ...@@ -447,7 +453,8 @@ static const char *tcodes[] = {
[0xe] = "link internal", [0xf] = "-reserved-", [0xe] = "link internal", [0xf] = "-reserved-",
}; };
static void log_ar_at_event(char dir, int speed, u32 *header, int evt) static void log_ar_at_event(struct fw_ohci *ohci,
char dir, int speed, u32 *header, int evt)
{ {
int tcode = header[0] >> 4 & 0xf; int tcode = header[0] >> 4 & 0xf;
char specific[12]; char specific[12];
...@@ -459,7 +466,8 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt) ...@@ -459,7 +466,8 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
evt = 0x1f; evt = 0x1f;
if (evt == OHCI1394_evt_bus_reset) { if (evt == OHCI1394_evt_bus_reset) {
fw_notify("A%c evt_bus_reset, generation %d\n", dev_notice(ohci->card.device,
"A%c evt_bus_reset, generation %d\n",
dir, (header[2] >> 16) & 0xff); dir, (header[2] >> 16) & 0xff);
return; return;
} }
...@@ -479,14 +487,18 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt) ...@@ -479,14 +487,18 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
switch (tcode) { switch (tcode) {
case 0xa: case 0xa:
fw_notify("A%c %s, %s\n", dir, evts[evt], tcodes[tcode]); dev_notice(ohci->card.device,
"A%c %s, %s\n",
dir, evts[evt], tcodes[tcode]);
break; break;
case 0xe: case 0xe:
fw_notify("A%c %s, PHY %08x %08x\n", dev_notice(ohci->card.device,
"A%c %s, PHY %08x %08x\n",
dir, evts[evt], header[1], header[2]); dir, evts[evt], header[1], header[2]);
break; break;
case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
fw_notify("A%c spd %x tl %02x, " dev_notice(ohci->card.device,
"A%c spd %x tl %02x, "
"%04x -> %04x, %s, " "%04x -> %04x, %s, "
"%s, %04x%08x%s\n", "%s, %04x%08x%s\n",
dir, speed, header[0] >> 10 & 0x3f, dir, speed, header[0] >> 10 & 0x3f,
...@@ -494,7 +506,8 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt) ...@@ -494,7 +506,8 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
tcodes[tcode], header[1] & 0xffff, header[2], specific); tcodes[tcode], header[1] & 0xffff, header[2], specific);
break; break;
default: default:
fw_notify("A%c spd %x tl %02x, " dev_notice(ohci->card.device,
"A%c spd %x tl %02x, "
"%04x -> %04x, %s, " "%04x -> %04x, %s, "
"%s%s\n", "%s%s\n",
dir, speed, header[0] >> 10 & 0x3f, dir, speed, header[0] >> 10 & 0x3f,
...@@ -506,9 +519,9 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt) ...@@ -506,9 +519,9 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
#else #else
#define param_debug 0 #define param_debug 0
static inline void log_irqs(u32 evt) {} static inline void log_irqs(struct fw_ohci *ohci, u32 evt) {}
static inline void log_selfids(int node_id, int generation, int self_id_count, u32 *s) {} static inline void log_selfids(struct fw_ohci *ohci, int generation, int self_id_count) {}
static inline void log_ar_at_event(char dir, int speed, u32 *header, int evt) {} static inline void log_ar_at_event(struct fw_ohci *ohci, char dir, int speed, u32 *header, int evt) {}
#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */ #endif /* CONFIG_FIREWIRE_OHCI_DEBUG */
...@@ -555,7 +568,7 @@ static int read_phy_reg(struct fw_ohci *ohci, int addr) ...@@ -555,7 +568,7 @@ static int read_phy_reg(struct fw_ohci *ohci, int addr)
if (i >= 3) if (i >= 3)
msleep(1); msleep(1);
} }
fw_error("failed to read phy reg\n"); dev_err(ohci->card.device, "failed to read phy reg\n");
return -EBUSY; return -EBUSY;
} }
...@@ -577,7 +590,7 @@ static int write_phy_reg(const struct fw_ohci *ohci, int addr, u32 val) ...@@ -577,7 +590,7 @@ static int write_phy_reg(const struct fw_ohci *ohci, int addr, u32 val)
if (i >= 3) if (i >= 3)
msleep(1); msleep(1);
} }
fw_error("failed to write phy reg\n"); dev_err(ohci->card.device, "failed to write phy reg\n");
return -EBUSY; return -EBUSY;
} }
...@@ -676,11 +689,14 @@ static void ar_context_release(struct ar_context *ctx) ...@@ -676,11 +689,14 @@ static void ar_context_release(struct ar_context *ctx)
static void ar_context_abort(struct ar_context *ctx, const char *error_msg) static void ar_context_abort(struct ar_context *ctx, const char *error_msg)
{ {
if (reg_read(ctx->ohci, CONTROL_CLEAR(ctx->regs)) & CONTEXT_RUN) { struct fw_ohci *ohci = ctx->ohci;
reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
flush_writes(ctx->ohci);
fw_error("AR error: %s; DMA stopped\n", error_msg); if (reg_read(ohci, CONTROL_CLEAR(ctx->regs)) & CONTEXT_RUN) {
reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
flush_writes(ohci);
dev_err(ohci->card.device, "AR error: %s; DMA stopped\n",
error_msg);
} }
/* FIXME: restart? */ /* FIXME: restart? */
} }
...@@ -850,7 +866,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer) ...@@ -850,7 +866,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
p.timestamp = status & 0xffff; p.timestamp = status & 0xffff;
p.generation = ohci->request_generation; p.generation = ohci->request_generation;
log_ar_at_event('R', p.speed, p.header, evt); log_ar_at_event(ohci, 'R', p.speed, p.header, evt);
/* /*
* Several controllers, notably from NEC and VIA, forget to * Several controllers, notably from NEC and VIA, forget to
...@@ -1222,21 +1238,22 @@ static void context_append(struct context *ctx, ...@@ -1222,21 +1238,22 @@ static void context_append(struct context *ctx,
static void context_stop(struct context *ctx) static void context_stop(struct context *ctx)
{ {
struct fw_ohci *ohci = ctx->ohci;
u32 reg; u32 reg;
int i; int i;
reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
ctx->running = false; ctx->running = false;
for (i = 0; i < 1000; i++) { for (i = 0; i < 1000; i++) {
reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs)); reg = reg_read(ohci, CONTROL_SET(ctx->regs));
if ((reg & CONTEXT_ACTIVE) == 0) if ((reg & CONTEXT_ACTIVE) == 0)
return; return;
if (i) if (i)
udelay(10); udelay(10);
} }
fw_error("Error: DMA context still active (0x%08x)\n", reg); dev_err(ohci->card.device, "DMA context still active (0x%08x)\n", reg);
} }
struct driver_data { struct driver_data {
...@@ -1416,7 +1433,7 @@ static int handle_at_packet(struct context *context, ...@@ -1416,7 +1433,7 @@ static int handle_at_packet(struct context *context,
evt = le16_to_cpu(last->transfer_status) & 0x1f; evt = le16_to_cpu(last->transfer_status) & 0x1f;
packet->timestamp = le16_to_cpu(last->res_count); packet->timestamp = le16_to_cpu(last->res_count);
log_ar_at_event('T', packet->speed, packet->header, evt); log_ar_at_event(ohci, 'T', packet->speed, packet->header, evt);
switch (evt) { switch (evt) {
case OHCI1394_evt_timeout: case OHCI1394_evt_timeout:
...@@ -1545,7 +1562,7 @@ static void handle_local_lock(struct fw_ohci *ohci, ...@@ -1545,7 +1562,7 @@ static void handle_local_lock(struct fw_ohci *ohci,
goto out; goto out;
} }
fw_error("swap not done (CSR lock timeout)\n"); dev_err(ohci->card.device, "swap not done (CSR lock timeout)\n");
fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0);
out: out:
...@@ -1621,10 +1638,12 @@ static void detect_dead_context(struct fw_ohci *ohci, ...@@ -1621,10 +1638,12 @@ static void detect_dead_context(struct fw_ohci *ohci,
ctl = reg_read(ohci, CONTROL_SET(regs)); ctl = reg_read(ohci, CONTROL_SET(regs));
if (ctl & CONTEXT_DEAD) { if (ctl & CONTEXT_DEAD) {
#ifdef CONFIG_FIREWIRE_OHCI_DEBUG #ifdef CONFIG_FIREWIRE_OHCI_DEBUG
fw_error("DMA context %s has stopped, error code: %s\n", dev_err(ohci->card.device,
"DMA context %s has stopped, error code: %s\n",
name, evts[ctl & 0x1f]); name, evts[ctl & 0x1f]);
#else #else
fw_error("DMA context %s has stopped, error code: %#x\n", dev_err(ohci->card.device,
"DMA context %s has stopped, error code: %#x\n",
name, ctl & 0x1f); name, ctl & 0x1f);
#endif #endif
} }
...@@ -1777,7 +1796,8 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) ...@@ -1777,7 +1796,8 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count)
reg = reg_read(ohci, OHCI1394_NodeID); reg = reg_read(ohci, OHCI1394_NodeID);
if (!(reg & OHCI1394_NodeID_idValid)) { if (!(reg & OHCI1394_NodeID_idValid)) {
fw_notify("node ID not valid, new bus reset in progress\n"); dev_notice(ohci->card.device,
"node ID not valid, new bus reset in progress\n");
return -EBUSY; return -EBUSY;
} }
self_id |= ((reg & 0x3f) << 24); /* phy ID */ self_id |= ((reg & 0x3f) << 24); /* phy ID */
...@@ -1823,11 +1843,12 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1823,11 +1843,12 @@ static void bus_reset_work(struct work_struct *work)
reg = reg_read(ohci, OHCI1394_NodeID); reg = reg_read(ohci, OHCI1394_NodeID);
if (!(reg & OHCI1394_NodeID_idValid)) { if (!(reg & OHCI1394_NodeID_idValid)) {
fw_notify("node ID not valid, new bus reset in progress\n"); dev_notice(ohci->card.device,
"node ID not valid, new bus reset in progress\n");
return; return;
} }
if ((reg & OHCI1394_NodeID_nodeNumber) == 63) { if ((reg & OHCI1394_NodeID_nodeNumber) == 63) {
fw_notify("malconfigured bus\n"); dev_notice(ohci->card.device, "malconfigured bus\n");
return; return;
} }
ohci->node_id = reg & (OHCI1394_NodeID_busNumber | ohci->node_id = reg & (OHCI1394_NodeID_busNumber |
...@@ -1841,7 +1862,7 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1841,7 +1862,7 @@ static void bus_reset_work(struct work_struct *work)
reg = reg_read(ohci, OHCI1394_SelfIDCount); reg = reg_read(ohci, OHCI1394_SelfIDCount);
if (reg & OHCI1394_SelfIDCount_selfIDError) { if (reg & OHCI1394_SelfIDCount_selfIDError) {
fw_notify("inconsistent self IDs\n"); dev_notice(ohci->card.device, "inconsistent self IDs\n");
return; return;
} }
/* /*
...@@ -1853,7 +1874,7 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1853,7 +1874,7 @@ static void bus_reset_work(struct work_struct *work)
self_id_count = (reg >> 3) & 0xff; self_id_count = (reg >> 3) & 0xff;
if (self_id_count > 252) { if (self_id_count > 252) {
fw_notify("inconsistent self IDs\n"); dev_notice(ohci->card.device, "inconsistent self IDs\n");
return; return;
} }
...@@ -1871,11 +1892,13 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1871,11 +1892,13 @@ static void bus_reset_work(struct work_struct *work)
*/ */
if (cond_le32_to_cpu(ohci->self_id_cpu[i]) if (cond_le32_to_cpu(ohci->self_id_cpu[i])
== 0xffff008f) { == 0xffff008f) {
fw_notify("ignoring spurious self IDs\n"); dev_notice(ohci->card.device,
"ignoring spurious self IDs\n");
self_id_count = j; self_id_count = j;
break; break;
} else { } else {
fw_notify("inconsistent self IDs\n"); dev_notice(ohci->card.device,
"inconsistent self IDs\n");
return; return;
} }
} }
...@@ -1886,13 +1909,14 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1886,13 +1909,14 @@ static void bus_reset_work(struct work_struct *work)
if (ohci->quirks & QUIRK_TI_SLLZ059) { if (ohci->quirks & QUIRK_TI_SLLZ059) {
self_id_count = find_and_insert_self_id(ohci, self_id_count); self_id_count = find_and_insert_self_id(ohci, self_id_count);
if (self_id_count < 0) { if (self_id_count < 0) {
fw_notify("could not construct local self ID\n"); dev_notice(ohci->card.device,
"could not construct local self ID\n");
return; return;
} }
} }
if (self_id_count == 0) { if (self_id_count == 0) {
fw_notify("inconsistent self IDs\n"); dev_notice(ohci->card.device, "inconsistent self IDs\n");
return; return;
} }
rmb(); rmb();
...@@ -1913,8 +1937,8 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1913,8 +1937,8 @@ static void bus_reset_work(struct work_struct *work)
new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff; new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff;
if (new_generation != generation) { if (new_generation != generation) {
fw_notify("recursive bus reset detected, " dev_notice(ohci->card.device,
"discarding self ids\n"); "new bus reset, discarding self ids\n");
return; return;
} }
...@@ -1985,8 +2009,7 @@ static void bus_reset_work(struct work_struct *work) ...@@ -1985,8 +2009,7 @@ static void bus_reset_work(struct work_struct *work)
dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
free_rom, free_rom_bus); free_rom, free_rom_bus);
log_selfids(ohci->node_id, generation, log_selfids(ohci, generation, self_id_count);
self_id_count, ohci->self_id_buffer);
fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation, fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
self_id_count, ohci->self_id_buffer, self_id_count, ohci->self_id_buffer,
...@@ -2011,7 +2034,7 @@ static irqreturn_t irq_handler(int irq, void *data) ...@@ -2011,7 +2034,7 @@ static irqreturn_t irq_handler(int irq, void *data)
*/ */
reg_write(ohci, OHCI1394_IntEventClear, reg_write(ohci, OHCI1394_IntEventClear,
event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
log_irqs(event); log_irqs(ohci, event);
if (event & OHCI1394_selfIDComplete) if (event & OHCI1394_selfIDComplete)
queue_work(fw_workqueue, &ohci->bus_reset_work); queue_work(fw_workqueue, &ohci->bus_reset_work);
...@@ -2053,8 +2076,8 @@ static irqreturn_t irq_handler(int irq, void *data) ...@@ -2053,8 +2076,8 @@ static irqreturn_t irq_handler(int irq, void *data)
} }
if (unlikely(event & OHCI1394_regAccessFail)) if (unlikely(event & OHCI1394_regAccessFail))
fw_error("Register access failure - " dev_err(ohci->card.device,
"please notify linux1394-devel@lists.sf.net\n"); "register access failure - please notify linux1394-devel@lists.sf.net\n");
if (unlikely(event & OHCI1394_postedWriteErr)) { if (unlikely(event & OHCI1394_postedWriteErr)) {
reg_read(ohci, OHCI1394_PostedWriteAddressHi); reg_read(ohci, OHCI1394_PostedWriteAddressHi);
...@@ -2062,12 +2085,13 @@ static irqreturn_t irq_handler(int irq, void *data) ...@@ -2062,12 +2085,13 @@ static irqreturn_t irq_handler(int irq, void *data)
reg_write(ohci, OHCI1394_IntEventClear, reg_write(ohci, OHCI1394_IntEventClear,
OHCI1394_postedWriteErr); OHCI1394_postedWriteErr);
if (printk_ratelimit()) if (printk_ratelimit())
fw_error("PCI posted write error\n"); dev_err(ohci->card.device, "PCI posted write error\n");
} }
if (unlikely(event & OHCI1394_cycleTooLong)) { if (unlikely(event & OHCI1394_cycleTooLong)) {
if (printk_ratelimit()) if (printk_ratelimit())
fw_notify("isochronous cycle too long\n"); dev_notice(ohci->card.device,
"isochronous cycle too long\n");
reg_write(ohci, OHCI1394_LinkControlSet, reg_write(ohci, OHCI1394_LinkControlSet,
OHCI1394_LinkControl_cycleMaster); OHCI1394_LinkControl_cycleMaster);
} }
...@@ -2080,7 +2104,8 @@ static irqreturn_t irq_handler(int irq, void *data) ...@@ -2080,7 +2104,8 @@ static irqreturn_t irq_handler(int irq, void *data)
* them at least two cycles later. (FIXME?) * them at least two cycles later. (FIXME?)
*/ */
if (printk_ratelimit()) if (printk_ratelimit())
fw_notify("isochronous cycle inconsistent\n"); dev_notice(ohci->card.device,
"isochronous cycle inconsistent\n");
} }
if (unlikely(event & OHCI1394_unrecoverableError)) if (unlikely(event & OHCI1394_unrecoverableError))
...@@ -2207,7 +2232,7 @@ static int ohci_enable(struct fw_card *card, ...@@ -2207,7 +2232,7 @@ static int ohci_enable(struct fw_card *card,
int i, ret; int i, ret;
if (software_reset(ohci)) { if (software_reset(ohci)) {
fw_error("Failed to reset ohci card.\n"); dev_err(card->device, "failed to reset ohci card\n");
return -EBUSY; return -EBUSY;
} }
...@@ -2231,7 +2256,7 @@ static int ohci_enable(struct fw_card *card, ...@@ -2231,7 +2256,7 @@ static int ohci_enable(struct fw_card *card,
} }
if (!lps) { if (!lps) {
fw_error("Failed to set Link Power Status\n"); dev_err(card->device, "failed to set Link Power Status\n");
return -EIO; return -EIO;
} }
...@@ -2240,7 +2265,7 @@ static int ohci_enable(struct fw_card *card, ...@@ -2240,7 +2265,7 @@ static int ohci_enable(struct fw_card *card,
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ret) if (ret)
fw_notify("local TSB41BA3D phy\n"); dev_notice(card->device, "local TSB41BA3D phy\n");
else else
ohci->quirks &= ~QUIRK_TI_SLLZ059; ohci->quirks &= ~QUIRK_TI_SLLZ059;
} }
...@@ -2340,7 +2365,8 @@ static int ohci_enable(struct fw_card *card, ...@@ -2340,7 +2365,8 @@ static int ohci_enable(struct fw_card *card,
if (request_irq(dev->irq, irq_handler, if (request_irq(dev->irq, irq_handler,
pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED,
ohci_driver_name, ohci)) { ohci_driver_name, ohci)) {
fw_error("Failed to allocate interrupt %d.\n", dev->irq); dev_err(card->device, "failed to allocate interrupt %d\n",
dev->irq);
pci_disable_msi(dev); pci_disable_msi(dev);
if (config_rom) { if (config_rom) {
...@@ -2505,7 +2531,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) ...@@ -2505,7 +2531,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
dma_unmap_single(ohci->card.device, packet->payload_bus, dma_unmap_single(ohci->card.device, packet->payload_bus,
packet->payload_length, DMA_TO_DEVICE); packet->payload_length, DMA_TO_DEVICE);
log_ar_at_event('T', packet->speed, packet->header, 0x20); log_ar_at_event(ohci, 'T', packet->speed, packet->header, 0x20);
driver_data->packet = NULL; driver_data->packet = NULL;
packet->ack = RCODE_CANCELLED; packet->ack = RCODE_CANCELLED;
packet->callback(packet, &ohci->card, packet->ack); packet->callback(packet, &ohci->card, packet->ack);
...@@ -3459,7 +3485,7 @@ static int __devinit pci_probe(struct pci_dev *dev, ...@@ -3459,7 +3485,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
err = pci_enable_device(dev); err = pci_enable_device(dev);
if (err) { if (err) {
fw_error("Failed to enable OHCI hardware\n"); dev_err(&dev->dev, "failed to enable OHCI hardware\n");
goto fail_free; goto fail_free;
} }
...@@ -3474,13 +3500,13 @@ static int __devinit pci_probe(struct pci_dev *dev, ...@@ -3474,13 +3500,13 @@ static int __devinit pci_probe(struct pci_dev *dev,
err = pci_request_region(dev, 0, ohci_driver_name); err = pci_request_region(dev, 0, ohci_driver_name);
if (err) { if (err) {
fw_error("MMIO resource unavailable\n"); dev_err(&dev->dev, "MMIO resource unavailable\n");
goto fail_disable; goto fail_disable;
} }
ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE);
if (ohci->registers == NULL) { if (ohci->registers == NULL) {
fw_error("Failed to remap registers\n"); dev_err(&dev->dev, "failed to remap registers\n");
err = -ENXIO; err = -ENXIO;
goto fail_iomem; goto fail_iomem;
} }
...@@ -3569,9 +3595,10 @@ static int __devinit pci_probe(struct pci_dev *dev, ...@@ -3569,9 +3595,10 @@ static int __devinit pci_probe(struct pci_dev *dev,
goto fail_contexts; goto fail_contexts;
version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
fw_notify("Added fw-ohci device %s, OHCI v%x.%x, " dev_notice(&dev->dev,
"added OHCI v%x.%x device as card %d, "
"%d IR + %d IT contexts, quirks 0x%x\n", "%d IR + %d IT contexts, quirks 0x%x\n",
dev_name(&dev->dev), version >> 16, version & 0xff, version >> 16, version & 0xff, ohci->card.index,
ohci->n_ir, ohci->n_it, ohci->quirks); ohci->n_ir, ohci->n_it, ohci->quirks);
return 0; return 0;
...@@ -3600,7 +3627,7 @@ static int __devinit pci_probe(struct pci_dev *dev, ...@@ -3600,7 +3627,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
pmac_ohci_off(dev); pmac_ohci_off(dev);
fail: fail:
if (err == -ENOMEM) if (err == -ENOMEM)
fw_error("Out of memory\n"); dev_err(&dev->dev, "out of memory\n");
return err; return err;
} }
...@@ -3644,7 +3671,7 @@ static void pci_remove(struct pci_dev *dev) ...@@ -3644,7 +3671,7 @@ static void pci_remove(struct pci_dev *dev)
kfree(ohci); kfree(ohci);
pmac_ohci_off(dev); pmac_ohci_off(dev);
fw_notify("Removed fw-ohci device.\n"); dev_notice(&dev->dev, "removed fw-ohci device\n");
} }
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -3658,12 +3685,12 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state) ...@@ -3658,12 +3685,12 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state)
pci_disable_msi(dev); pci_disable_msi(dev);
err = pci_save_state(dev); err = pci_save_state(dev);
if (err) { if (err) {
fw_error("pci_save_state failed\n"); dev_err(&dev->dev, "pci_save_state failed\n");
return err; return err;
} }
err = pci_set_power_state(dev, pci_choose_state(dev, state)); err = pci_set_power_state(dev, pci_choose_state(dev, state));
if (err) if (err)
fw_error("pci_set_power_state failed with %d\n", err); dev_err(&dev->dev, "pci_set_power_state failed with %d\n", err);
pmac_ohci_off(dev); pmac_ohci_off(dev);
return 0; return 0;
...@@ -3679,7 +3706,7 @@ static int pci_resume(struct pci_dev *dev) ...@@ -3679,7 +3706,7 @@ static int pci_resume(struct pci_dev *dev)
pci_restore_state(dev); pci_restore_state(dev);
err = pci_enable_device(dev); err = pci_enable_device(dev);
if (err) { if (err) {
fw_error("pci_enable_device failed\n"); dev_err(&dev->dev, "pci_enable_device failed\n");
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册