firewire: add fw_csr_string() helper function

The core (sysfs attributes), the firedtv driver, and possible future
drivers all read strings from some configuration ROM directory.  Factor
out the generic code from show_text_leaf() into a new helper function,
modified slightly to handle arbitrary buffer sizes.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
Clemens Ladisch
2009-12-24 11:59:57 +01:00
committed by Stefan Richter
parent 5d7db0499e
commit 1f8fef7b33
3 changed files with 84 additions and 67 deletions

View File

@ -72,6 +72,8 @@ struct fw_csr_iterator {
void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p);
int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value);
int fw_csr_string(u32 *directory, int key, char *buf, size_t size);
extern struct bus_type fw_bus_type;
struct fw_card_driver;