diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2013-03-26 11:54:06 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2013-04-30 14:30:16 -0400 |
commit | de97cb64a959fe5ccf828b02d3a78de9f9defb67 (patch) | |
tree | db560da2162a7084687c2a032c2534c0a1c3ff1b | |
parent | bd972688eb2404239a8f1255db26b0bb6b604686 (diff) |
firewire: ohci: Alias dev_* log functions
Convert dev_xxxx(ohci->card.device, ...) log functions to
ohci_xxxx(ohci, ...).
[Stefan R: Peter argues that this increases readability of the code.]
[Stefan R: changed whitespace]
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | drivers/firewire/ohci.c | 143 |
1 files changed, 65 insertions, 78 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 77a64bf18029..925a2a6fe68f 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -54,6 +54,10 @@ | |||
54 | #include "core.h" | 54 | #include "core.h" |
55 | #include "ohci.h" | 55 | #include "ohci.h" |
56 | 56 | ||
57 | #define ohci_info(ohci, f, args...) dev_info(ohci->card.device, f, ##args) | ||
58 | #define ohci_notice(ohci, f, args...) dev_notice(ohci->card.device, f, ##args) | ||
59 | #define ohci_err(ohci, f, args...) dev_err(ohci->card.device, f, ##args) | ||
60 | |||
57 | #define DESCRIPTOR_OUTPUT_MORE 0 | 61 | #define DESCRIPTOR_OUTPUT_MORE 0 |
58 | #define DESCRIPTOR_OUTPUT_LAST (1 << 12) | 62 | #define DESCRIPTOR_OUTPUT_LAST (1 << 12) |
59 | #define DESCRIPTOR_INPUT_MORE (2 << 12) | 63 | #define DESCRIPTOR_INPUT_MORE (2 << 12) |
@@ -374,8 +378,7 @@ static void log_irqs(struct fw_ohci *ohci, u32 evt) | |||
374 | !(evt & OHCI1394_busReset)) | 378 | !(evt & OHCI1394_busReset)) |
375 | return; | 379 | return; |
376 | 380 | ||
377 | dev_notice(ohci->card.device, | 381 | ohci_notice(ohci, "IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, |
378 | "IRQ %08x%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", evt, | ||
379 | evt & OHCI1394_selfIDComplete ? " selfID" : "", | 382 | evt & OHCI1394_selfIDComplete ? " selfID" : "", |
380 | evt & OHCI1394_RQPkt ? " AR_req" : "", | 383 | evt & OHCI1394_RQPkt ? " AR_req" : "", |
381 | evt & OHCI1394_RSPkt ? " AR_resp" : "", | 384 | evt & OHCI1394_RSPkt ? " AR_resp" : "", |
@@ -421,21 +424,19 @@ static void log_selfids(struct fw_ohci *ohci, int generation, int self_id_count) | |||
421 | if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) | 424 | if (likely(!(param_debug & OHCI_PARAM_DEBUG_SELFIDS))) |
422 | return; | 425 | return; |
423 | 426 | ||
424 | dev_notice(ohci->card.device, | 427 | ohci_notice(ohci, "%d selfIDs, generation %d, local node ID %04x\n", |
425 | "%d selfIDs, generation %d, local node ID %04x\n", | 428 | self_id_count, generation, ohci->node_id); |
426 | self_id_count, generation, ohci->node_id); | ||
427 | 429 | ||
428 | for (s = ohci->self_id_buffer; self_id_count--; ++s) | 430 | for (s = ohci->self_id_buffer; self_id_count--; ++s) |
429 | if ((*s & 1 << 23) == 0) | 431 | if ((*s & 1 << 23) == 0) |
430 | dev_notice(ohci->card.device, | 432 | ohci_notice(ohci, |
431 | "selfID 0: %08x, phy %d [%c%c%c] " | 433 | "selfID 0: %08x, phy %d [%c%c%c] %s gc=%d %s %s%s%s\n", |
432 | "%s gc=%d %s %s%s%s\n", | ||
433 | *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), | 434 | *s, *s >> 24 & 63, _p(s, 6), _p(s, 4), _p(s, 2), |
434 | speed[*s >> 14 & 3], *s >> 16 & 63, | 435 | speed[*s >> 14 & 3], *s >> 16 & 63, |
435 | power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", | 436 | power[*s >> 8 & 7], *s >> 22 & 1 ? "L" : "", |
436 | *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); | 437 | *s >> 11 & 1 ? "c" : "", *s & 2 ? "i" : ""); |
437 | else | 438 | else |
438 | dev_notice(ohci->card.device, | 439 | ohci_notice(ohci, |
439 | "selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n", | 440 | "selfID n: %08x, phy %d [%c%c%c%c%c%c%c%c]\n", |
440 | *s, *s >> 24 & 63, | 441 | *s, *s >> 24 & 63, |
441 | _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), | 442 | _p(s, 16), _p(s, 14), _p(s, 12), _p(s, 10), |
@@ -485,9 +486,8 @@ static void log_ar_at_event(struct fw_ohci *ohci, | |||
485 | evt = 0x1f; | 486 | evt = 0x1f; |
486 | 487 | ||
487 | if (evt == OHCI1394_evt_bus_reset) { | 488 | if (evt == OHCI1394_evt_bus_reset) { |
488 | dev_notice(ohci->card.device, | 489 | ohci_notice(ohci, "A%c evt_bus_reset, generation %d\n", |
489 | "A%c evt_bus_reset, generation %d\n", | 490 | dir, (header[2] >> 16) & 0xff); |
490 | dir, (header[2] >> 16) & 0xff); | ||
491 | return; | 491 | return; |
492 | } | 492 | } |
493 | 493 | ||
@@ -506,32 +506,26 @@ static void log_ar_at_event(struct fw_ohci *ohci, | |||
506 | 506 | ||
507 | switch (tcode) { | 507 | switch (tcode) { |
508 | case 0xa: | 508 | case 0xa: |
509 | dev_notice(ohci->card.device, | 509 | ohci_notice(ohci, "A%c %s, %s\n", |
510 | "A%c %s, %s\n", | 510 | dir, evts[evt], tcodes[tcode]); |
511 | dir, evts[evt], tcodes[tcode]); | ||
512 | break; | 511 | break; |
513 | case 0xe: | 512 | case 0xe: |
514 | dev_notice(ohci->card.device, | 513 | ohci_notice(ohci, "A%c %s, PHY %08x %08x\n", |
515 | "A%c %s, PHY %08x %08x\n", | 514 | dir, evts[evt], header[1], header[2]); |
516 | dir, evts[evt], header[1], header[2]); | ||
517 | break; | 515 | break; |
518 | case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: | 516 | case 0x0: case 0x1: case 0x4: case 0x5: case 0x9: |
519 | dev_notice(ohci->card.device, | 517 | ohci_notice(ohci, |
520 | "A%c spd %x tl %02x, " | 518 | "A%c spd %x tl %02x, %04x -> %04x, %s, %s, %04x%08x%s\n", |
521 | "%04x -> %04x, %s, " | 519 | dir, speed, header[0] >> 10 & 0x3f, |
522 | "%s, %04x%08x%s\n", | 520 | header[1] >> 16, header[0] >> 16, evts[evt], |
523 | dir, speed, header[0] >> 10 & 0x3f, | 521 | tcodes[tcode], header[1] & 0xffff, header[2], specific); |
524 | header[1] >> 16, header[0] >> 16, evts[evt], | ||
525 | tcodes[tcode], header[1] & 0xffff, header[2], specific); | ||
526 | break; | 522 | break; |
527 | default: | 523 | default: |
528 | dev_notice(ohci->card.device, | 524 | ohci_notice(ohci, |
529 | "A%c spd %x tl %02x, " | 525 | "A%c spd %x tl %02x, %04x -> %04x, %s, %s%s\n", |
530 | "%04x -> %04x, %s, " | 526 | dir, speed, header[0] >> 10 & 0x3f, |
531 | "%s%s\n", | 527 | header[1] >> 16, header[0] >> 16, evts[evt], |
532 | dir, speed, header[0] >> 10 & 0x3f, | 528 | tcodes[tcode], specific); |
533 | header[1] >> 16, header[0] >> 16, evts[evt], | ||
534 | tcodes[tcode], specific); | ||
535 | } | 529 | } |
536 | } | 530 | } |
537 | 531 | ||
@@ -578,7 +572,7 @@ static int read_phy_reg(struct fw_ohci *ohci, int addr) | |||
578 | if (i >= 3) | 572 | if (i >= 3) |
579 | msleep(1); | 573 | msleep(1); |
580 | } | 574 | } |
581 | dev_err(ohci->card.device, "failed to read phy reg\n"); | 575 | ohci_err(ohci, "failed to read phy reg\n"); |
582 | 576 | ||
583 | return -EBUSY; | 577 | return -EBUSY; |
584 | } | 578 | } |
@@ -600,7 +594,7 @@ static int write_phy_reg(const struct fw_ohci *ohci, int addr, u32 val) | |||
600 | if (i >= 3) | 594 | if (i >= 3) |
601 | msleep(1); | 595 | msleep(1); |
602 | } | 596 | } |
603 | dev_err(ohci->card.device, "failed to write phy reg\n"); | 597 | ohci_err(ohci, "failed to write phy reg\n"); |
604 | 598 | ||
605 | return -EBUSY; | 599 | return -EBUSY; |
606 | } | 600 | } |
@@ -705,8 +699,7 @@ static void ar_context_abort(struct ar_context *ctx, const char *error_msg) | |||
705 | reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); | 699 | reg_write(ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); |
706 | flush_writes(ohci); | 700 | flush_writes(ohci); |
707 | 701 | ||
708 | dev_err(ohci->card.device, "AR error: %s; DMA stopped\n", | 702 | ohci_err(ohci, "AR error: %s; DMA stopped\n", error_msg); |
709 | error_msg); | ||
710 | } | 703 | } |
711 | /* FIXME: restart? */ | 704 | /* FIXME: restart? */ |
712 | } | 705 | } |
@@ -1285,7 +1278,7 @@ static void context_stop(struct context *ctx) | |||
1285 | if (i) | 1278 | if (i) |
1286 | udelay(10); | 1279 | udelay(10); |
1287 | } | 1280 | } |
1288 | dev_err(ohci->card.device, "DMA context still active (0x%08x)\n", reg); | 1281 | ohci_err(ohci, "DMA context still active (0x%08x)\n", reg); |
1289 | } | 1282 | } |
1290 | 1283 | ||
1291 | struct driver_data { | 1284 | struct driver_data { |
@@ -1594,7 +1587,7 @@ static void handle_local_lock(struct fw_ohci *ohci, | |||
1594 | goto out; | 1587 | goto out; |
1595 | } | 1588 | } |
1596 | 1589 | ||
1597 | dev_err(ohci->card.device, "swap not done (CSR lock timeout)\n"); | 1590 | ohci_err(ohci, "swap not done (CSR lock timeout)\n"); |
1598 | fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); | 1591 | fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); |
1599 | 1592 | ||
1600 | out: | 1593 | out: |
@@ -1669,8 +1662,7 @@ static void detect_dead_context(struct fw_ohci *ohci, | |||
1669 | 1662 | ||
1670 | ctl = reg_read(ohci, CONTROL_SET(regs)); | 1663 | ctl = reg_read(ohci, CONTROL_SET(regs)); |
1671 | if (ctl & CONTEXT_DEAD) | 1664 | if (ctl & CONTEXT_DEAD) |
1672 | dev_err(ohci->card.device, | 1665 | ohci_err(ohci, "DMA context %s has stopped, error code: %s\n", |
1673 | "DMA context %s has stopped, error code: %s\n", | ||
1674 | name, evts[ctl & 0x1f]); | 1666 | name, evts[ctl & 0x1f]); |
1675 | } | 1667 | } |
1676 | 1668 | ||
@@ -1852,8 +1844,8 @@ static int find_and_insert_self_id(struct fw_ohci *ohci, int self_id_count) | |||
1852 | 1844 | ||
1853 | reg = reg_read(ohci, OHCI1394_NodeID); | 1845 | reg = reg_read(ohci, OHCI1394_NodeID); |
1854 | if (!(reg & OHCI1394_NodeID_idValid)) { | 1846 | if (!(reg & OHCI1394_NodeID_idValid)) { |
1855 | dev_notice(ohci->card.device, | 1847 | ohci_notice(ohci, |
1856 | "node ID not valid, new bus reset in progress\n"); | 1848 | "node ID not valid, new bus reset in progress\n"); |
1857 | return -EBUSY; | 1849 | return -EBUSY; |
1858 | } | 1850 | } |
1859 | self_id |= ((reg & 0x3f) << 24); /* phy ID */ | 1851 | self_id |= ((reg & 0x3f) << 24); /* phy ID */ |
@@ -1900,12 +1892,12 @@ static void bus_reset_work(struct work_struct *work) | |||
1900 | 1892 | ||
1901 | reg = reg_read(ohci, OHCI1394_NodeID); | 1893 | reg = reg_read(ohci, OHCI1394_NodeID); |
1902 | if (!(reg & OHCI1394_NodeID_idValid)) { | 1894 | if (!(reg & OHCI1394_NodeID_idValid)) { |
1903 | dev_notice(ohci->card.device, | 1895 | ohci_notice(ohci, |
1904 | "node ID not valid, new bus reset in progress\n"); | 1896 | "node ID not valid, new bus reset in progress\n"); |
1905 | return; | 1897 | return; |
1906 | } | 1898 | } |
1907 | if ((reg & OHCI1394_NodeID_nodeNumber) == 63) { | 1899 | if ((reg & OHCI1394_NodeID_nodeNumber) == 63) { |
1908 | dev_notice(ohci->card.device, "malconfigured bus\n"); | 1900 | ohci_notice(ohci, "malconfigured bus\n"); |
1909 | return; | 1901 | return; |
1910 | } | 1902 | } |
1911 | ohci->node_id = reg & (OHCI1394_NodeID_busNumber | | 1903 | ohci->node_id = reg & (OHCI1394_NodeID_busNumber | |
@@ -1919,7 +1911,7 @@ static void bus_reset_work(struct work_struct *work) | |||
1919 | 1911 | ||
1920 | reg = reg_read(ohci, OHCI1394_SelfIDCount); | 1912 | reg = reg_read(ohci, OHCI1394_SelfIDCount); |
1921 | if (reg & OHCI1394_SelfIDCount_selfIDError) { | 1913 | if (reg & OHCI1394_SelfIDCount_selfIDError) { |
1922 | dev_notice(ohci->card.device, "inconsistent self IDs\n"); | 1914 | ohci_notice(ohci, "inconsistent self IDs\n"); |
1923 | return; | 1915 | return; |
1924 | } | 1916 | } |
1925 | /* | 1917 | /* |
@@ -1931,7 +1923,7 @@ static void bus_reset_work(struct work_struct *work) | |||
1931 | self_id_count = (reg >> 3) & 0xff; | 1923 | self_id_count = (reg >> 3) & 0xff; |
1932 | 1924 | ||
1933 | if (self_id_count > 252) { | 1925 | if (self_id_count > 252) { |
1934 | dev_notice(ohci->card.device, "inconsistent self IDs\n"); | 1926 | ohci_notice(ohci, "inconsistent self IDs\n"); |
1935 | return; | 1927 | return; |
1936 | } | 1928 | } |
1937 | 1929 | ||
@@ -1949,13 +1941,12 @@ static void bus_reset_work(struct work_struct *work) | |||
1949 | */ | 1941 | */ |
1950 | if (cond_le32_to_cpu(ohci->self_id_cpu[i]) | 1942 | if (cond_le32_to_cpu(ohci->self_id_cpu[i]) |
1951 | == 0xffff008f) { | 1943 | == 0xffff008f) { |
1952 | dev_notice(ohci->card.device, | 1944 | ohci_notice(ohci, |
1953 | "ignoring spurious self IDs\n"); | 1945 | "ignoring spurious self IDs\n"); |
1954 | self_id_count = j; | 1946 | self_id_count = j; |
1955 | break; | 1947 | break; |
1956 | } else { | 1948 | } else { |
1957 | dev_notice(ohci->card.device, | 1949 | ohci_notice(ohci, "inconsistent self IDs\n"); |
1958 | "inconsistent self IDs\n"); | ||
1959 | return; | 1950 | return; |
1960 | } | 1951 | } |
1961 | } | 1952 | } |
@@ -1966,14 +1957,14 @@ static void bus_reset_work(struct work_struct *work) | |||
1966 | if (ohci->quirks & QUIRK_TI_SLLZ059) { | 1957 | if (ohci->quirks & QUIRK_TI_SLLZ059) { |
1967 | self_id_count = find_and_insert_self_id(ohci, self_id_count); | 1958 | self_id_count = find_and_insert_self_id(ohci, self_id_count); |
1968 | if (self_id_count < 0) { | 1959 | if (self_id_count < 0) { |
1969 | dev_notice(ohci->card.device, | 1960 | ohci_notice(ohci, |
1970 | "could not construct local self ID\n"); | 1961 | "could not construct local self ID\n"); |
1971 | return; | 1962 | return; |
1972 | } | 1963 | } |
1973 | } | 1964 | } |
1974 | 1965 | ||
1975 | if (self_id_count == 0) { | 1966 | if (self_id_count == 0) { |
1976 | dev_notice(ohci->card.device, "inconsistent self IDs\n"); | 1967 | ohci_notice(ohci, "inconsistent self IDs\n"); |
1977 | return; | 1968 | return; |
1978 | } | 1969 | } |
1979 | rmb(); | 1970 | rmb(); |
@@ -1994,8 +1985,7 @@ static void bus_reset_work(struct work_struct *work) | |||
1994 | 1985 | ||
1995 | new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff; | 1986 | new_generation = (reg_read(ohci, OHCI1394_SelfIDCount) >> 16) & 0xff; |
1996 | if (new_generation != generation) { | 1987 | if (new_generation != generation) { |
1997 | dev_notice(ohci->card.device, | 1988 | ohci_notice(ohci, "new bus reset, discarding self ids\n"); |
1998 | "new bus reset, discarding self ids\n"); | ||
1999 | return; | 1989 | return; |
2000 | } | 1990 | } |
2001 | 1991 | ||
@@ -2133,7 +2123,7 @@ static irqreturn_t irq_handler(int irq, void *data) | |||
2133 | } | 2123 | } |
2134 | 2124 | ||
2135 | if (unlikely(event & OHCI1394_regAccessFail)) | 2125 | if (unlikely(event & OHCI1394_regAccessFail)) |
2136 | dev_err(ohci->card.device, "register access failure\n"); | 2126 | ohci_err(ohci, "register access failure\n"); |
2137 | 2127 | ||
2138 | if (unlikely(event & OHCI1394_postedWriteErr)) { | 2128 | if (unlikely(event & OHCI1394_postedWriteErr)) { |
2139 | reg_read(ohci, OHCI1394_PostedWriteAddressHi); | 2129 | reg_read(ohci, OHCI1394_PostedWriteAddressHi); |
@@ -2141,13 +2131,12 @@ static irqreturn_t irq_handler(int irq, void *data) | |||
2141 | reg_write(ohci, OHCI1394_IntEventClear, | 2131 | reg_write(ohci, OHCI1394_IntEventClear, |
2142 | OHCI1394_postedWriteErr); | 2132 | OHCI1394_postedWriteErr); |
2143 | if (printk_ratelimit()) | 2133 | if (printk_ratelimit()) |
2144 | dev_err(ohci->card.device, "PCI posted write error\n"); | 2134 | ohci_err(ohci, "PCI posted write error\n"); |
2145 | } | 2135 | } |
2146 | 2136 | ||
2147 | if (unlikely(event & OHCI1394_cycleTooLong)) { | 2137 | if (unlikely(event & OHCI1394_cycleTooLong)) { |
2148 | if (printk_ratelimit()) | 2138 | if (printk_ratelimit()) |
2149 | dev_notice(ohci->card.device, | 2139 | ohci_notice(ohci, "isochronous cycle too long\n"); |
2150 | "isochronous cycle too long\n"); | ||
2151 | reg_write(ohci, OHCI1394_LinkControlSet, | 2140 | reg_write(ohci, OHCI1394_LinkControlSet, |
2152 | OHCI1394_LinkControl_cycleMaster); | 2141 | OHCI1394_LinkControl_cycleMaster); |
2153 | } | 2142 | } |
@@ -2160,8 +2149,7 @@ static irqreturn_t irq_handler(int irq, void *data) | |||
2160 | * them at least two cycles later. (FIXME?) | 2149 | * them at least two cycles later. (FIXME?) |
2161 | */ | 2150 | */ |
2162 | if (printk_ratelimit()) | 2151 | if (printk_ratelimit()) |
2163 | dev_notice(ohci->card.device, | 2152 | ohci_notice(ohci, "isochronous cycle inconsistent\n"); |
2164 | "isochronous cycle inconsistent\n"); | ||
2165 | } | 2153 | } |
2166 | 2154 | ||
2167 | if (unlikely(event & OHCI1394_unrecoverableError)) | 2155 | if (unlikely(event & OHCI1394_unrecoverableError)) |
@@ -2287,7 +2275,7 @@ static int ohci_enable(struct fw_card *card, | |||
2287 | int i, ret; | 2275 | int i, ret; |
2288 | 2276 | ||
2289 | if (software_reset(ohci)) { | 2277 | if (software_reset(ohci)) { |
2290 | dev_err(card->device, "failed to reset ohci card\n"); | 2278 | ohci_err(ohci, "failed to reset ohci card\n"); |
2291 | return -EBUSY; | 2279 | return -EBUSY; |
2292 | } | 2280 | } |
2293 | 2281 | ||
@@ -2322,7 +2310,7 @@ static int ohci_enable(struct fw_card *card, | |||
2322 | } | 2310 | } |
2323 | 2311 | ||
2324 | if (!lps) { | 2312 | if (!lps) { |
2325 | dev_err(card->device, "failed to set Link Power Status\n"); | 2313 | ohci_err(ohci, "failed to set Link Power Status\n"); |
2326 | return -EIO; | 2314 | return -EIO; |
2327 | } | 2315 | } |
2328 | 2316 | ||
@@ -2331,7 +2319,7 @@ static int ohci_enable(struct fw_card *card, | |||
2331 | if (ret < 0) | 2319 | if (ret < 0) |
2332 | return ret; | 2320 | return ret; |
2333 | if (ret) | 2321 | if (ret) |
2334 | dev_notice(card->device, "local TSB41BA3D phy\n"); | 2322 | ohci_notice(ohci, "local TSB41BA3D phy\n"); |
2335 | else | 2323 | else |
2336 | ohci->quirks &= ~QUIRK_TI_SLLZ059; | 2324 | ohci->quirks &= ~QUIRK_TI_SLLZ059; |
2337 | } | 2325 | } |
@@ -3607,20 +3595,20 @@ static int pci_probe(struct pci_dev *dev, | |||
3607 | 3595 | ||
3608 | if (!(pci_resource_flags(dev, 0) & IORESOURCE_MEM) || | 3596 | if (!(pci_resource_flags(dev, 0) & IORESOURCE_MEM) || |
3609 | pci_resource_len(dev, 0) < OHCI1394_REGISTER_SIZE) { | 3597 | pci_resource_len(dev, 0) < OHCI1394_REGISTER_SIZE) { |
3610 | dev_err(&dev->dev, "invalid MMIO resource\n"); | 3598 | ohci_err(ohci, "invalid MMIO resource\n"); |
3611 | err = -ENXIO; | 3599 | err = -ENXIO; |
3612 | goto fail_disable; | 3600 | goto fail_disable; |
3613 | } | 3601 | } |
3614 | 3602 | ||
3615 | err = pci_request_region(dev, 0, ohci_driver_name); | 3603 | err = pci_request_region(dev, 0, ohci_driver_name); |
3616 | if (err) { | 3604 | if (err) { |
3617 | dev_err(&dev->dev, "MMIO resource unavailable\n"); | 3605 | ohci_err(ohci, "MMIO resource unavailable\n"); |
3618 | goto fail_disable; | 3606 | goto fail_disable; |
3619 | } | 3607 | } |
3620 | 3608 | ||
3621 | ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); | 3609 | ohci->registers = pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); |
3622 | if (ohci->registers == NULL) { | 3610 | if (ohci->registers == NULL) { |
3623 | dev_err(&dev->dev, "failed to remap registers\n"); | 3611 | ohci_err(ohci, "failed to remap registers\n"); |
3624 | err = -ENXIO; | 3612 | err = -ENXIO; |
3625 | goto fail_iomem; | 3613 | goto fail_iomem; |
3626 | } | 3614 | } |
@@ -3709,8 +3697,7 @@ static int pci_probe(struct pci_dev *dev, | |||
3709 | if (request_irq(dev->irq, irq_handler, | 3697 | if (request_irq(dev->irq, irq_handler, |
3710 | pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, | 3698 | pci_dev_msi_enabled(dev) ? 0 : IRQF_SHARED, |
3711 | ohci_driver_name, ohci)) { | 3699 | ohci_driver_name, ohci)) { |
3712 | dev_err(&dev->dev, "failed to allocate interrupt %d\n", | 3700 | ohci_err(ohci, "failed to allocate interrupt %d\n", dev->irq); |
3713 | dev->irq); | ||
3714 | err = -EIO; | 3701 | err = -EIO; |
3715 | goto fail_msi; | 3702 | goto fail_msi; |
3716 | } | 3703 | } |
@@ -3720,11 +3707,11 @@ static int pci_probe(struct pci_dev *dev, | |||
3720 | goto fail_irq; | 3707 | goto fail_irq; |
3721 | 3708 | ||
3722 | version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; | 3709 | version = reg_read(ohci, OHCI1394_Version) & 0x00ff00ff; |
3723 | dev_notice(&dev->dev, | 3710 | ohci_notice(ohci, |
3724 | "added OHCI v%x.%x device as card %d, " | 3711 | "added OHCI v%x.%x device as card %d, " |
3725 | "%d IR + %d IT contexts, quirks 0x%x\n", | 3712 | "%d IR + %d IT contexts, quirks 0x%x\n", |
3726 | version >> 16, version & 0xff, ohci->card.index, | 3713 | version >> 16, version & 0xff, ohci->card.index, |
3727 | ohci->n_ir, ohci->n_it, ohci->quirks); | 3714 | ohci->n_ir, ohci->n_it, ohci->quirks); |
3728 | 3715 | ||
3729 | return 0; | 3716 | return 0; |
3730 | 3717 | ||
@@ -3814,12 +3801,12 @@ static int pci_suspend(struct pci_dev *dev, pm_message_t state) | |||
3814 | software_reset(ohci); | 3801 | software_reset(ohci); |
3815 | err = pci_save_state(dev); | 3802 | err = pci_save_state(dev); |
3816 | if (err) { | 3803 | if (err) { |
3817 | dev_err(&dev->dev, "pci_save_state failed\n"); | 3804 | ohci_err(ohci, "pci_save_state failed\n"); |
3818 | return err; | 3805 | return err; |
3819 | } | 3806 | } |
3820 | err = pci_set_power_state(dev, pci_choose_state(dev, state)); | 3807 | err = pci_set_power_state(dev, pci_choose_state(dev, state)); |
3821 | if (err) | 3808 | if (err) |
3822 | dev_err(&dev->dev, "pci_set_power_state failed with %d\n", err); | 3809 | ohci_err(ohci, "pci_set_power_state failed with %d\n", err); |
3823 | pmac_ohci_off(dev); | 3810 | pmac_ohci_off(dev); |
3824 | 3811 | ||
3825 | return 0; | 3812 | return 0; |
@@ -3835,7 +3822,7 @@ static int pci_resume(struct pci_dev *dev) | |||
3835 | pci_restore_state(dev); | 3822 | pci_restore_state(dev); |
3836 | err = pci_enable_device(dev); | 3823 | err = pci_enable_device(dev); |
3837 | if (err) { | 3824 | if (err) { |
3838 | dev_err(&dev->dev, "pci_enable_device failed\n"); | 3825 | ohci_err(ohci, "pci_enable_device failed\n"); |
3839 | return err; | 3826 | return err; |
3840 | } | 3827 | } |
3841 | 3828 | ||