diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2012-04-11 17:38:10 +0200 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2012-04-17 22:54:55 +0200 |
commit | 7bdbff6762a573b911e4ee5715779d8ee6a62631 (patch) | |
tree | 446701cfe10e48a735997053f279d2e9b11975fd /sound | |
parent | db7494e2ce616f2e39e877cf9143b7d873701ec6 (diff) | |
download | linux-7bdbff6762a573b911e4ee5715779d8ee6a62631.tar.gz linux-7bdbff6762a573b911e4ee5715779d8ee6a62631.tar.bz2 linux-7bdbff6762a573b911e4ee5715779d8ee6a62631.zip |
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')
-rw-r--r-- | sound/firewire/cmp.c | 2 | ||||
-rw-r--r-- | sound/firewire/lib.c | 28 | ||||
-rw-r--r-- | sound/firewire/lib.h | 1 |
3 files changed, 2 insertions, 29 deletions
diff --git a/sound/firewire/cmp.c b/sound/firewire/cmp.c index 76294f2ae47f..645cb0ba4293 100644 --- a/sound/firewire/cmp.c +++ b/sound/firewire/cmp.c @@ -84,7 +84,7 @@ static int pcr_modify(struct cmp_connection *c, return 0; io_error: - cmp_error(c, "transaction failed: %s\n", rcode_string(rcode)); + cmp_error(c, "transaction failed: %s\n", fw_rcode_string(rcode)); return -EIO; bus_reset: 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 @@ #define ERROR_RETRY_DELAY_MS 5 /** - * rcode_string - convert a firewire result code to a string - * @rcode: the result - */ -const char *rcode_string(unsigned int rcode) -{ - static const char *const names[] = { - [RCODE_COMPLETE] = "complete", - [RCODE_CONFLICT_ERROR] = "conflict error", - [RCODE_DATA_ERROR] = "data error", - [RCODE_TYPE_ERROR] = "type error", - [RCODE_ADDRESS_ERROR] = "address error", - [RCODE_SEND_ERROR] = "send error", - [RCODE_CANCELLED] = "cancelled", - [RCODE_BUSY] = "busy", - [RCODE_GENERATION] = "generation", - [RCODE_NO_ACK] = "no ack", - }; - - if (rcode < ARRAY_SIZE(names) && names[rcode]) - return names[rcode]; - else - return "unknown"; -} -EXPORT_SYMBOL(rcode_string); - -/** * snd_fw_transaction - send a request and wait for its completion * @unit: the driver's unit on the target device * @tcode: the transaction code @@ -71,7 +45,7 @@ int snd_fw_transaction(struct fw_unit *unit, int tcode, if (rcode_is_permanent_error(rcode) || ++tries >= 3) { dev_err(&unit->device, "transaction failed: %s\n", - rcode_string(rcode)); + fw_rcode_string(rcode)); return -EIO; } diff --git a/sound/firewire/lib.h b/sound/firewire/lib.h index 064f3fd9ab06..aef301476ea9 100644 --- a/sound/firewire/lib.h +++ b/sound/firewire/lib.h @@ -8,7 +8,6 @@ struct fw_unit; int snd_fw_transaction(struct fw_unit *unit, int tcode, u64 offset, void *buffer, size_t length); -const char *rcode_string(unsigned int rcode); /* returns true if retrying the transaction would not make sense */ static inline bool rcode_is_permanent_error(int rcode) |