aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2011-12-20 15:32:46 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-01-15 12:37:21 -0500
commit64d2172019dcfe46508593c561c9906de95df567 (patch)
tree27130e09d87e8aaeb532284b7fcd3ce86613ce18 /drivers/firewire
parent210762268466634ddbfaddb48fdf5181ce4b5f2d (diff)
firewire: ohci: use dev_printk API
All messages are uniformly prefixed by driver name and device name now. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/ohci.c185
1 files changed, 106 insertions, 79 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 6628feaa7622..68b3c1b635f6 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -345,7 +345,7 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
345 ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS) 345 ", busReset events = " __stringify(OHCI_PARAM_DEBUG_BUSRESETS)
346 ", or a combination, or all = -1)"); 346 ", or a combination, or all = -1)");
347 347
348static void log_irqs(u32 evt) 348static void log_irqs(struct fw_ohci *ohci, u32 evt)
349{ 349{
350 if (likely(!(param_debug & 350 if (likely(!(param_debug &
351 (OHCI_PARAM_DEBUG_IRQS | OHCI_PARAM_DEBUG_BUSRESETS)))) 351 (OHCI_PARAM_DEBUG_IRQS | OHCI_PARAM_DEBUG_BUSRESETS))))
@@ -355,7 +355,8 @@ static void log_irqs(u32 evt)
355 !(evt & OHCI1394_busReset)) 355 !(evt & OHCI1394_busReset))
356 return; 356 return;
357 357
358 fw_notify("IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, 358 dev_notice(ohci->card.device,
359 "IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt,
359 evt & OHCI1394_selfIDComplete ? " selfID" : "", 360 evt & OHCI1394_selfIDComplete ? " selfID" : "",
360 evt & OHCI1394_RQPkt ? " AR_req" : "", 361 evt & OHCI1394_RQPkt ? " AR_req" : "",
361 evt & OHCI1394_RSPkt ? " AR_resp" : "", 362 evt & OHCI1394_RSPkt ? " AR_resp" : "",
@@ -394,24 +395,29 @@ static char _p(u32 *s, int shift)
394 return port[*s >> shift & 3]; 395 return port[*s >> shift & 3];
395} 396}
396 397
397static void log_selfids(int node_id, int generation, int self_id_count, u32 *s) 398static void log_selfids(struct fw_ohci *ohci, int generation, int self_id_count)
398{ 399{
400 u32 *s;
401
399 if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) 402 if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS)))
400 return; 403 return;
401 404
402 fw_notify("%d selfIDs, generation %d, local node ID %04x\n", 405 dev_notice(ohci->card.device,
403 self_id_count, generation, node_id); 406 "%d selfIDs, generation %d, local node ID %04x\n",
407 self_id_count, generation, ohci->node_id);
404 408
405 for (; self_id_count--; ++s) 409 for (s = ohci->self_id_buffer; self_id_count--; ++s)
406 if ((*s & 1 << 23) == 0) 410 if ((*s & 1 << 23) == 0)
407 fw_notify("selfID 0: %08x, phy %d [%c%c%c] " 411 dev_notice(ohci->card.device,
412 "selfID 0: %08x, phy %d [%c%c%c] "
408 "%s gc=%d %s %s%s%s\n", 413 "%s gc=%d %s %s%s%s\n",
409 *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), 414 *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2),
410 speed[*s >> 14 & 3], *s >> 16 & 63, 415 speed[*s >> 14 & 3], *s >> 16 & 63,
411 power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", 416 power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "",
412 *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); 417 *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : "");
413 else 418 else
414 fw_notify("selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n", 419 dev_notice(ohci->card.device,
420 "selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n",
415 *s, *s >> 24 & 63, 421 *s, *s >> 24 & 63,
416 _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), 422 _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10),
417 _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2)); 423 _p(s, 8), _p(s, 6), _p(s, 4), _p(s, 2));
@@ -447,7 +453,8 @@ static const char *tcodes[] = {
447 [0xe] = "link internal", [0xf] = "-reserved-", 453 [0xe] = "link internal", [0xf] = "-reserved-",
448}; 454};
449 455
450static void log_ar_at_event(char dir, int speed, u32 *header, int evt) 456static void log_ar_at_event(struct fw_ohci *ohci,
457 char dir, int speed, u32 *header, int evt)
451{ 458{
452 int tcode = header[0] >> 4 & 0xf; 459 int tcode = header[0] >> 4 & 0xf;
453 char specific[12]; 460 char specific[12];
@@ -459,8 +466,9 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
459 evt = 0x1f; 466 evt = 0x1f;
460 467
461 if (evt == OHCI1394_evt_bus_reset) { 468 if (evt == OHCI1394_evt_bus_reset) {
462 fw_notify("A%c evt_bus_reset, generation %d\n", 469 dev_notice(ohci->card.device,
463 dir, (header[2] >> 16) & 0xff); 470 "A%c evt_bus_reset, generation %d\n",
471 dir, (header[2] >> 16) & 0xff);
464 return; 472 return;
465 } 473 }
466 474
@@ -479,36 +487,41 @@ static void log_ar_at_event(char dir, int speed, u32 *header, int evt)
479 487
480 switch (tcode) { 488 switch (tcode) {
481 case 0xa: 489 case 0xa:
482 fw_notify("A%c %s, %s\n", dir, evts[evt], tcodes[tcode]); 490 dev_notice(ohci->card.device,
491 "A%c %s, %s\n",
492 dir, evts[evt], tcodes[tcode]);
483 break; 493 break;
484 case 0xe: 494 case 0xe:
485 fw_notify("A%c %s, PHY %08x %08x\n", 495 dev_notice(ohci->card.device,
486 dir, evts[evt], header[1], header[2]); 496 "A%c %s, PHY %08x %08x\n",
497 dir, evts[evt], header[1], header[2]);
487 break; 498 break;
488 case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: 499 case 0x0: case 0x1: case 0x4: case 0x5: case 0x9:
489 fw_notify("A%c spd %x tl %02x, " 500 dev_notice(ohci->card.device,
490 "%04x -> %04x, %s, " 501 "A%c spd %x tl %02x, "
491 "%s, %04x%08x%s\n", 502 "%04x -> %04x, %s, "
492 dir, speed, header[0] >> 10 & 0x3f, 503 "%s, %04x%08x%s\n",
493 header[1] >> 16, header[0] >> 16, evts[evt], 504 dir, speed, header[0] >> 10 & 0x3f,
494 tcodes[tcode], header[1] & 0xffff, header[2], specific); 505 header[1] >> 16, header[0] >> 16, evts[evt],
506 tcodes[tcode], header[1] & 0xffff, header[2], specific);
495 break; 507 break;
496 default: 508 default:
497 fw_notify("A%c spd %x tl %02x, " 509 dev_notice(ohci->card.device,
498 "%04x -> %04x, %s, " 510 "A%c spd %x tl %02x, "
499 "%s%s\n", 511 "%04x -> %04x, %s, "
500 dir, speed, header[0] >> 10 & 0x3f, 512 "%s%s\n",
501 header[1] >> 16, header[0] >> 16, evts[evt], 513 dir, speed, header[0] >> 10 & 0x3f,
502 tcodes[tcode], specific); 514 header[1] >> 16, header[0] >> 16, evts[evt],
515 tcodes[tcode], specific);
503 } 516 }
504} 517}
505 518
506#else 519#else
507 520
508#define param_debug 0 521#define param_debug 0
509static inline void log_irqs(u32 evt) {} 522static inline void log_irqs(struct fw_ohci *ohci, u32 evt) {}
510static inline void log_selfids(int node_id, int generation, int self_id_count, u32 *s) {} 523static inline void log_selfids(struct fw_ohci *ohci, int generation, int self_id_count) {}
511static inline void log_ar_at_event(char dir, int speed, u32 *header, int evt) {} 524static inline void log_ar_at_event(struct fw_ohci *ohci, char dir, int speed, u32 *header, int evt) {}
512 525
513#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */ 526#endif /* CONFIG_FIREWIRE_OHCI_DEBUG */
514 527
@@ -555,7 +568,7 @@ static int read_phy_reg(struct fw_ohci *ohci, int addr)
555 if (i >= 3) 568 if (i >= 3)
556 msleep(1); 569 msleep(1);
557 } 570 }
558 fw_error("failed to read phy reg\n"); 571 dev_err(ohci->card.device, "failed to read phy reg\n");
559 572
560 return -EBUSY; 573 return -EBUSY;
561} 574}
@@ -577,7 +590,7 @@ static int write_phy_reg(const struct fw_ohci *ohci, int addr, u32 val)
577 if (i >= 3) 590 if (i >= 3)
578 msleep(1); 591 msleep(1);
579 } 592 }
580 fw_error("failed to write phy reg\n"); 593 dev_err(ohci->card.device, "failed to write phy reg\n");
581 594
582 return -EBUSY; 595 return -EBUSY;
583} 596}
@@ -676,11 +689,14 @@ static void ar_context_release(struct ar_context *ctx)
676 689
677static void ar_context_abort(struct ar_context *ctx, const char *error_msg) 690static void ar_context_abort(struct ar_context *ctx, const char *error_msg)
678{ 691{
679 if (reg_read(ctx->ohci, CONTROL_CLEAR(ctx->regs)) & CONTEXT_RUN) { 692 struct fw_ohci *ohci = ctx->ohci;
680 reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
681 flush_writes(ctx->ohci);
682 693
683 fw_error("AR error: %s; DMA stopped\n", error_msg); 694 if (reg_read(ohci, CONTROL_CLEAR(ctx->regs)) & CONTEXT_RUN) {
695 reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
696 flush_writes(ohci);
697
698 dev_err(ohci->card.device, "AR error: %s; DMA stopped\n",
699 error_msg);
684 } 700 }
685 /* FIXME: restart? */ 701 /* FIXME: restart? */
686} 702}
@@ -850,7 +866,7 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer)
850 p.timestamp = status & 0xffff; 866 p.timestamp = status & 0xffff;
851 p.generation = ohci->request_generation; 867 p.generation = ohci->request_generation;
852 868
853 log_ar_at_event('R', p.speed, p.header, evt); 869 log_ar_at_event(ohci, 'R', p.speed, p.header, evt);
854 870
855 /* 871 /*
856 * Several controllers, notably from NEC and VIA, forget to 872 * Several controllers, notably from NEC and VIA, forget to
@@ -1222,21 +1238,22 @@ static void context_append(struct context *ctx,
1222 1238
1223static void context_stop(struct context *ctx) 1239static void context_stop(struct context *ctx)
1224{ 1240{
1241 struct fw_ohci *ohci = ctx->ohci;
1225 u32 reg; 1242 u32 reg;
1226 int i; 1243 int i;
1227 1244
1228 reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); 1245 reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
1229 ctx->running = false; 1246 ctx->running = false;
1230 1247
1231 for (i = 0; i < 1000; i++) { 1248 for (i = 0; i < 1000; i++) {
1232 reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs)); 1249 reg = reg_read(ohci, CONTROL_SET(ctx->regs));
1233 if ((reg & CONTEXT_ACTIVE) == 0) 1250 if ((reg & CONTEXT_ACTIVE) == 0)
1234 return; 1251 return;
1235 1252
1236 if (i) 1253 if (i)
1237 udelay(10); 1254 udelay(10);
1238 } 1255 }
1239 fw_error("Error: DMA context still active (0x%08x)\n", reg); 1256 dev_err(ohci->card.device, "DMA context still active (0x%08x)\n", reg);
1240} 1257}
1241 1258
1242struct driver_data { 1259struct driver_data {
@@ -1416,7 +1433,7 @@ static int handle_at_packet(struct context *context,
1416 evt = le16_to_cpu(last->transfer_status) & 0x1f; 1433 evt = le16_to_cpu(last->transfer_status) & 0x1f;
1417 packet->timestamp = le16_to_cpu(last->res_count); 1434 packet->timestamp = le16_to_cpu(last->res_count);
1418 1435
1419 log_ar_at_event('T', packet->speed, packet->header, evt); 1436 log_ar_at_event(ohci, 'T', packet->speed, packet->header, evt);
1420 1437
1421 switch (evt) { 1438 switch (evt) {
1422 case OHCI1394_evt_timeout: 1439 case OHCI1394_evt_timeout:
@@ -1545,7 +1562,7 @@ static void handle_local_lock(struct fw_ohci *ohci,
1545 goto out; 1562 goto out;
1546 } 1563 }
1547 1564
1548 fw_error("swap not done (CSR lock timeout)\n"); 1565 dev_err(ohci->card.device, "swap not done (CSR lock timeout)\n");
1549 fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); 1566 fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0);
1550 1567
1551 out: 1568 out:
@@ -1621,11 +1638,13 @@ static void detect_dead_context(struct fw_ohci *ohci,
1621 ctl = reg_read(ohci, CONTROL_SET(regs)); 1638 ctl = reg_read(ohci, CONTROL_SET(regs));
1622 if (ctl & CONTEXT_DEAD) { 1639 if (ctl & CONTEXT_DEAD) {
1623#ifdef CONFIG_FIREWIRE_OHCI_DEBUG 1640#ifdef CONFIG_FIREWIRE_OHCI_DEBUG
1624 fw_error("DMA context %s has stopped, error code: %s\n", 1641 dev_err(ohci->card.device,
1625 name, evts[ctl & 0x1f]); 1642 "DMA context %s has stopped, error code: %s\n",
1643 name, evts[ctl & 0x1f]);
1626#else 1644#else
1627 fw_error("DMA context %s has stopped, error code: %#x\n", 1645 dev_err(ohci->card.device,
1628 name, ctl & 0x1f); 1646 "DMA context %s has stopped, error code: %#x\n",
1647 name, ctl & 0x1f);
1629#endif 1648#endif
1630 } 1649 }
1631} 1650}
@@ -1777,7 +1796,8 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count)
1777 1796
1778 reg = reg_read(ohci, OHCI1394_NodeID); 1797 reg = reg_read(ohci, OHCI1394_NodeID);
1779 if (!(reg & OHCI1394_NodeID_idValid)) { 1798 if (!(reg & OHCI1394_NodeID_idValid)) {
1780 fw_notify("node ID not valid, new bus reset in progress\n"); 1799 dev_notice(ohci->card.device,
1800 "node ID not valid, new bus reset in progress\n");
1781 return -EBUSY; 1801 return -EBUSY;
1782 } 1802 }
1783 self_id |= ((reg & 0x3f) << 24); /* phy ID */ 1803 self_id |= ((reg & 0x3f) << 24); /* phy ID */
@@ -1823,11 +1843,12 @@ static void bus_reset_work(struct work_struct *work)
1823 1843
1824 reg = reg_read(ohci, OHCI1394_NodeID); 1844 reg = reg_read(ohci, OHCI1394_NodeID);
1825 if (!(reg & OHCI1394_NodeID_idValid)) { 1845 if (!(reg & OHCI1394_NodeID_idValid)) {
1826 fw_notify("node ID not valid, new bus reset in progress\n"); 1846 dev_notice(ohci->card.device,
1847 "node ID not valid, new bus reset in progress\n");
1827 return; 1848 return;
1828 } 1849 }
1829 if ((reg & OHCI1394_NodeID_nodeNumber) == 63) { 1850 if ((reg & OHCI1394_NodeID_nodeNumber) == 63) {
1830 fw_notify("malconfigured bus\n"); 1851 dev_notice(ohci->card.device, "malconfigured bus\n");
1831 return; 1852 return;
1832 } 1853 }
1833 ohci->node_id = reg & (OHCI1394_NodeID_busNumber | 1854 ohci->node_id = reg & (OHCI1394_NodeID_busNumber |
@@ -1841,7 +1862,7 @@ static void bus_reset_work(struct work_struct *work)
1841 1862
1842 reg = reg_read(ohci, OHCI1394_SelfIDCount); 1863 reg = reg_read(ohci, OHCI1394_SelfIDCount);
1843 if (reg & OHCI1394_SelfIDCount_selfIDError) { 1864 if (reg & OHCI1394_SelfIDCount_selfIDError) {
1844 fw_notify("inconsistent self IDs\n"); 1865 dev_notice(ohci->card.device, "inconsistent self IDs\n");
1845 return; 1866 return;
1846 } 1867 }
1847 /* 1868 /*
@@ -1853,7 +1874,7 @@ static void bus_reset_work(struct work_struct *work)
1853 self_id_count = (reg >> 3) & 0xff; 1874 self_id_count = (reg >> 3) & 0xff;
1854 1875
1855 if (self_id_count > 252) { 1876 if (self_id_count > 252) {
1856 fw_notify("inconsistent self IDs\n"); 1877 dev_notice(ohci->card.device, "inconsistent self IDs\n");
1857 return; 1878 return;
1858 } 1879 }
1859 1880
@@ -1871,11 +1892,13 @@ static void bus_reset_work(struct work_struct *work)
1871 */ 1892 */
1872 if (cond_le32_to_cpu(ohci->self_id_cpu[i]) 1893 if (cond_le32_to_cpu(ohci->self_id_cpu[i])
1873 == 0xffff008f) { 1894 == 0xffff008f) {
1874 fw_notify("ignoring spurious self IDs\n"); 1895 dev_notice(ohci->card.device,
1896 "ignoring spurious self IDs\n");
1875 self_id_count = j; 1897 self_id_count = j;
1876 break; 1898 break;
1877 } else { 1899 } else {
1878 fw_notify("inconsistent self IDs\n"); 1900 dev_notice(ohci->card.device,
1901 "inconsistent self IDs\n");
1879 return; 1902 return;
1880 } 1903 }
1881 } 1904 }
@@ -1886,13 +1909,14 @@ static void bus_reset_work(struct work_struct *work)
1886 if (ohci->quirks & QUIRK_TI_SLLZ059) { 1909 if (ohci->quirks & QUIRK_TI_SLLZ059) {
1887 self_id_count = find_and_insert_self_id(ohci, self_id_count); 1910 self_id_count = find_and_insert_self_id(ohci, self_id_count);
1888 if (self_id_count < 0) { 1911 if (self_id_count < 0) {
1889 fw_notify("could not construct local self ID\n"); 1912 dev_notice(ohci->card.device,
1913 "could not construct local self ID\n");
1890 return; 1914 return;
1891 } 1915 }
1892 } 1916 }
1893 1917
1894 if (self_id_count == 0) { 1918 if (self_id_count == 0) {
1895 fw_notify("inconsistent self IDs\n"); 1919 dev_notice(ohci->card.device, "inconsistent self IDs\n");
1896 return; 1920 return;
1897 } 1921 }
1898 rmb(); 1922 rmb();
@@ -1913,8 +1937,8 @@ static void bus_reset_work(struct work_struct *work)
1913 1937
1914 new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff; 1938 new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff;
1915 if (new_generation != generation) { 1939 if (new_generation != generation) {
1916 fw_notify("recursive bus reset detected, " 1940 dev_notice(ohci->card.device,
1917 "discarding self ids\n"); 1941 "new bus reset, discarding self ids\n");
1918 return; 1942 return;
1919 } 1943 }
1920 1944
@@ -1985,8 +2009,7 @@ static void bus_reset_work(struct work_struct *work)
1985 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, 2009 dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE,
1986 free_rom, free_rom_bus); 2010 free_rom, free_rom_bus);
1987 2011
1988 log_selfids(ohci->node_id, generation, 2012 log_selfids(ohci, generation, self_id_count);
1989 self_id_count, ohci->self_id_buffer);
1990 2013
1991 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation, 2014 fw_core_handle_bus_reset(&ohci->card, ohci->node_id, generation,
1992 self_id_count, ohci->self_id_buffer, 2015 self_id_count, ohci->self_id_buffer,
@@ -2011,7 +2034,7 @@ static irqreturn_t irq_handler(int irq, void *data)
2011 */ 2034 */
2012 reg_write(ohci, OHCI1394_IntEventClear, 2035 reg_write(ohci, OHCI1394_IntEventClear,
2013 event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr)); 2036 event & ~(OHCI1394_busReset | OHCI1394_postedWriteErr));
2014 log_irqs(event); 2037 log_irqs(ohci, event);
2015 2038
2016 if (event & OHCI1394_selfIDComplete) 2039 if (event & OHCI1394_selfIDComplete)
2017 queue_work(fw_workqueue, &ohci->bus_reset_work); 2040 queue_work(fw_workqueue, &ohci->bus_reset_work);
@@ -2053,8 +2076,8 @@ static irqreturn_t irq_handler(int irq, void *data)
2053 } 2076 }
2054 2077
2055 if (unlikely(event & OHCI1394_regAccessFail)) 2078 if (unlikely(event & OHCI1394_regAccessFail))
2056 fw_error("Register access failure - " 2079 dev_err(ohci->card.device,
2057 "please notify linux1394-devel@lists.sf.net\n"); 2080 "register access failure - please notify linux1394-devel@lists.sf.net\n");
2058 2081
2059 if (unlikely(event & OHCI1394_postedWriteErr)) { 2082 if (unlikely(event & OHCI1394_postedWriteErr)) {
2060 reg_read(ohci, OHCI1394_PostedWriteAddressHi); 2083 reg_read(ohci, OHCI1394_PostedWriteAddressHi);
@@ -2062,12 +2085,13 @@ static irqreturn_t irq_handler(int irq, void *data)
2062 reg_write(ohci, OHCI1394_IntEventClear, 2085 reg_write(ohci, OHCI1394_IntEventClear,
2063 OHCI1394_postedWriteErr); 2086 OHCI1394_postedWriteErr);
2064 if (printk_ratelimit()) 2087 if (printk_ratelimit())
2065 fw_error("PCI posted write error\n"); 2088 dev_err(ohci->card.device, "PCI posted write error\n");
2066 } 2089 }
2067 2090
2068 if (unlikely(event & OHCI1394_cycleTooLong)) { 2091 if (unlikely(event & OHCI1394_cycleTooLong)) {
2069 if (printk_ratelimit()) 2092 if (printk_ratelimit())
2070 fw_notify("isochronous cycle too long\n"); 2093 dev_notice(ohci->card.device,
2094 "isochronous cycle too long\n");
2071 reg_write(ohci, OHCI1394_LinkControlSet, 2095 reg_write(ohci, OHCI1394_LinkControlSet,
2072 OHCI1394_LinkControl_cycleMaster); 2096 OHCI1394_LinkControl_cycleMaster);
2073 } 2097 }
@@ -2080,7 +2104,8 @@ static irqreturn_t irq_handler(int irq, void *data)
2080 * them at least two cycles later. (FIXME?) 2104 * them at least two cycles later. (FIXME?)
2081 */ 2105 */
2082 if (printk_ratelimit()) 2106 if (printk_ratelimit())
2083 fw_notify("isochronous cycle inconsistent\n"); 2107 dev_notice(ohci->card.device,
2108 "isochronous cycle inconsistent\n");
2084 } 2109 }
2085 2110
2086 if (unlikely(event & OHCI1394_unrecoverableError)) 2111 if (unlikely(event & OHCI1394_unrecoverableError))
@@ -2207,7 +2232,7 @@ static int ohci_enable(struct fw_card *card,
2207 int i, ret; 2232 int i, ret;
2208 2233
2209 if (software_reset(ohci)) { 2234 if (software_reset(ohci)) {
2210 fw_error("Failed to reset ohci card.\n"); 2235 dev_err(card->device, "failed to reset ohci card\n");
2211 return -EBUSY; 2236 return -EBUSY;
2212 } 2237 }
2213 2238
@@ -2231,7 +2256,7 @@ static int ohci_enable(struct fw_card *card,
2231 } 2256 }
2232 2257
2233 if (!lps) { 2258 if (!lps) {
2234 fw_error("Failed to set Link Power Status\n"); 2259 dev_err(card->device, "failed to set Link Power Status\n");
2235 return -EIO; 2260 return -EIO;
2236 } 2261 }
2237 2262
@@ -2240,7 +2265,7 @@ static int ohci_enable(struct fw_card *card,
2240 if (ret < 0) 2265 if (ret < 0)
2241 return ret; 2266 return ret;
2242 if (ret) 2267 if (ret)
2243 fw_notify("local TSB41BA3D phy\n"); 2268 dev_notice(card->device, "local TSB41BA3D phy\n");
2244 else 2269 else
2245 ohci->quirks &= ~QUIRK_TI_SLLZ059; 2270 ohci->quirks &= ~QUIRK_TI_SLLZ059;
2246 } 2271 }
@@ -2340,7 +2365,8 @@ static int ohci_enable(struct fw_card *card,
2340 if (request_irq(dev->irq, irq_handler, 2365 if (request_irq(dev->irq, irq_handler,
2341 pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, 2366 pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED,
2342 ohci_driver_name, ohci)) { 2367 ohci_driver_name, ohci)) {
2343 fw_error("Failed to allocate interrupt %d.\n", dev->irq); 2368 dev_err(card->device, "failed to allocate interrupt %d\n",
2369 dev->irq);
2344 pci_disable_msi(dev); 2370 pci_disable_msi(dev);
2345 2371
2346 if (config_rom) { 2372 if (config_rom) {
@@ -2505,7 +2531,7 @@ static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet)
2505 dma_unmap_single(ohci->card.device, packet->payload_bus, 2531 dma_unmap_single(ohci->card.device, packet->payload_bus,
2506 packet->payload_length, DMA_TO_DEVICE); 2532 packet->payload_length, DMA_TO_DEVICE);
2507 2533
2508 log_ar_at_event('T', packet->speed, packet->header, 0x20); 2534 log_ar_at_event(ohci, 'T', packet->speed, packet->header, 0x20);
2509 driver_data->packet = NULL; 2535 driver_data->packet = NULL;
2510 packet->ack = RCODE_CANCELLED; 2536 packet->ack = RCODE_CANCELLED;
2511 packet->callback(packet, &ohci->card, packet->ack); 2537 packet->callback(packet, &ohci->card, packet->ack);
@@ -3459,7 +3485,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
3459 3485
3460 err = pci_enable_device(dev); 3486 err = pci_enable_device(dev);
3461 if (err) { 3487 if (err) {
3462 fw_error("Failed to enable OHCI hardware\n"); 3488 dev_err(&dev->dev, "failed to enable OHCI hardware\n");
3463 goto fail_free; 3489 goto fail_free;
3464 } 3490 }
3465 3491
@@ -3474,13 +3500,13 @@ static int __devinit pci_probe(struct pci_dev *dev,
3474 3500
3475 err = pci_request_region(dev, 0, ohci_driver_name); 3501 err = pci_request_region(dev, 0, ohci_driver_name);
3476 if (err) { 3502 if (err) {
3477 fw_error("MMIO resource unavailable\n"); 3503 dev_err(&dev->dev, "MMIO resource unavailable\n");
3478 goto fail_disable; 3504 goto fail_disable;
3479 } 3505 }
3480 3506
3481 ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); 3507 ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE);
3482 if (ohci->registers == NULL) { 3508 if (ohci->registers == NULL) {
3483 fw_error("Failed to remap registers\n"); 3509 dev_err(&dev->dev, "failed to remap registers\n");
3484 err = -ENXIO; 3510 err = -ENXIO;
3485 goto fail_iomem; 3511 goto fail_iomem;
3486 } 3512 }
@@ -3569,9 +3595,10 @@ static int __devinit pci_probe(struct pci_dev *dev,
3569 goto fail_contexts; 3595 goto fail_contexts;
3570 3596
3571 version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; 3597 version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff;
3572 fw_notify("Added fw-ohci device %s, OHCI v%x.%x, " 3598 dev_notice(&dev->dev,
3599 "added OHCI v%x.%x device as card %d, "
3573 "%d IR + %d IT contexts, quirks 0x%x\n", 3600 "%d IR + %d IT contexts, quirks 0x%x\n",
3574 dev_name(&dev->dev), version >> 16, version & 0xff, 3601 version >> 16, version & 0xff, ohci->card.index,
3575 ohci->n_ir, ohci->n_it, ohci->quirks); 3602 ohci->n_ir, ohci->n_it, ohci->quirks);
3576 3603
3577 return 0; 3604 return 0;
@@ -3600,7 +3627,7 @@ static int __devinit pci_probe(struct pci_dev *dev,
3600 pmac_ohci_off(dev); 3627 pmac_ohci_off(dev);
3601 fail: 3628 fail:
3602 if (err == -ENOMEM) 3629 if (err == -ENOMEM)
3603 fw_error("Out of memory\n"); 3630 dev_err(&dev->dev, "out of memory\n");
3604 3631
3605 return err; 3632 return err;
3606} 3633}
@@ -3644,7 +3671,7 @@ static void pci_remove(struct pci_dev *dev)
3644 kfree(ohci); 3671 kfree(ohci);
3645 pmac_ohci_off(dev); 3672 pmac_ohci_off(dev);
3646 3673
3647 fw_notify("Removed fw-ohci device.\n"); 3674 dev_notice(&dev->dev, "removed fw-ohci device\n");
3648} 3675}
3649 3676
3650#ifdef CONFIG_PM 3677#ifdef CONFIG_PM
@@ -3658,12 +3685,12 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state)
3658 pci_disable_msi(dev); 3685 pci_disable_msi(dev);
3659 err = pci_save_state(dev); 3686 err = pci_save_state(dev);
3660 if (err) { 3687 if (err) {
3661 fw_error("pci_save_state failed\n"); 3688 dev_err(&dev->dev, "pci_save_state failed\n");
3662 return err; 3689 return err;
3663 } 3690 }
3664 err = pci_set_power_state(dev, pci_choose_state(dev, state)); 3691 err = pci_set_power_state(dev, pci_choose_state(dev, state));
3665 if (err) 3692 if (err)
3666 fw_error("pci_set_power_state failed with %d\n", err); 3693 dev_err(&dev->dev, "pci_set_power_state failed with %d\n", err);
3667 pmac_ohci_off(dev); 3694 pmac_ohci_off(dev);
3668 3695
3669 return 0; 3696 return 0;
@@ -3679,7 +3706,7 @@ static int pci_resume(struct pci_dev *dev)
3679 pci_restore_state(dev); 3706 pci_restore_state(dev);
3680 err = pci_enable_device(dev); 3707 err = pci_enable_device(dev);
3681 if (err) { 3708 if (err) {
3682 fw_error("pci_enable_device failed\n"); 3709 dev_err(&dev->dev, "pci_enable_device failed\n");
3683 return err; 3710 return err;
3684 } 3711 }
3685 3712