aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
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 /drivers/firewire
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 'drivers/firewire')
-rw-r--r--drivers/firewire/core-transaction.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index dea2dcc9310d..1c4980c32f90 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -994,6 +994,32 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p)
994} 994}
995EXPORT_SYMBOL(fw_core_handle_response); 995EXPORT_SYMBOL(fw_core_handle_response);
996 996
997/**
998 * fw_rcode_string - convert a firewire result code to an error description
999 * @rcode: the result code
1000 */
1001const char *fw_rcode_string(int rcode)
1002{
1003 static const char *const names[] = {
1004 [RCODE_COMPLETE] = "no error",
1005 [RCODE_CONFLICT_ERROR] = "conflict error",
1006 [RCODE_DATA_ERROR] = "data error",
1007 [RCODE_TYPE_ERROR] = "type error",
1008 [RCODE_ADDRESS_ERROR] = "address error",
1009 [RCODE_SEND_ERROR] = "send error",
1010 [RCODE_CANCELLED] = "timeout",
1011 [RCODE_BUSY] = "busy",
1012 [RCODE_GENERATION] = "bus reset",
1013 [RCODE_NO_ACK] = "no ack",
1014 };
1015
1016 if ((unsigned int)rcode < ARRAY_SIZE(names) && names[rcode])
1017 return names[rcode];
1018 else
1019 return "unknown";
1020}
1021EXPORT_SYMBOL(fw_rcode_string);
1022
997static const struct fw_address_region topology_map_region = 1023static const struct fw_address_region topology_map_region =
998 { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP, 1024 { .start = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP,
999 .end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, }; 1025 .end = CSR_REGISTER_BASE | CSR_TOPOLOGY_MAP_END, };