aboutsummaryrefslogtreecommitdiffstats
path: root/sound/firewire/lib.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2012-04-11 11:38:10 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2012-04-17 16:54:55 -0400
commit7bdbff6762a573b911e4ee5715779d8ee6a62631 (patch)
tree446701cfe10e48a735997053f279d2e9b11975fd /sound/firewire/lib.c
parentdb7494e2ce616f2e39e877cf9143b7d873701ec6 (diff)
firewire: move rcode_string() to core
There is nothing audio-specific about the rcode_string() helper, so move it from snd-firewire-lib into firewire-core to allow other code to use it. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (fixed sound/firewire/cmp.c)
Diffstat (limited to 'sound/firewire/lib.c')
-rw-r--r--sound/firewire/lib.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/sound/firewire/lib.c b/sound/firewire/lib.c
index 4750cea2210e..14eb41498372 100644
--- a/sound/firewire/lib.c
+++ b/sound/firewire/lib.c
@@ -14,32 +14,6 @@
14#define ERROR_RETRY_DELAY_MS 5 14#define ERROR_RETRY_DELAY_MS 5
15 15
16/** 16/**
17 * rcode_string - convert a firewire result code to a string
18 * @rcode: the result
19 */
20const char *rcode_string(unsigned int rcode)
21{
22 static const char *const names[] = {
23 [RCODE_COMPLETE] = "complete",
24 [RCODE_CONFLICT_ERROR] = "conflict error",
25 [RCODE_DATA_ERROR] = "data error",
26 [RCODE_TYPE_ERROR] = "type error",
27 [RCODE_ADDRESS_ERROR] = "address error",
28 [RCODE_SEND_ERROR] = "send error",
29 [RCODE_CANCELLED] = "cancelled",
30 [RCODE_BUSY] = "busy",
31 [RCODE_GENERATION] = "generation",
32 [RCODE_NO_ACK] = "no ack",
33 };
34
35 if (rcode < ARRAY_SIZE(names) && names[rcode])
36 return names[rcode];
37 else
38 return "unknown";
39}
40EXPORT_SYMBOL(rcode_string);
41
42/**
43 * snd_fw_transaction - send a request and wait for its completion 17 * snd_fw_transaction - send a request and wait for its completion
44 * @unit: the driver's unit on the target device 18 * @unit: the driver's unit on the target device
45 * @tcode: the transaction code 19 * @tcode: the transaction code
@@ -71,7 +45,7 @@ int snd_fw_transaction(struct fw_unit *unit, int tcode,
71 45
72 if (rcode_is_permanent_error(rcode) || ++tries >= 3) { 46 if (rcode_is_permanent_error(rcode) || ++tries >= 3) {
73 dev_err(&unit->device, "transaction failed: %s\n", 47 dev_err(&unit->device, "transaction failed: %s\n",
74 rcode_string(rcode)); 48 fw_rcode_string(rcode));
75 return -EIO; 49 return -EIO;
76 } 50 }
77 51