Skip to content

Commit f6cdd89

Browse files
committed
Merge tag 'firewire-fixes-6.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull firewire fixes from Takashi Sakamoto: "FireWire subsystem now supports the legacy layout of configuration ROM, while it appears that some of DV devices in the early 2000's have the legacy layout with a quirk. This includes some changes to handle the quirk" * tag 'firewire-fixes-6.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: core: search descriptor leaf just after vendor directory entry in root directory firewire: core: correct documentation of fw_csr_string() kernel API
2 parents 6a864c0 + 47dc551 commit f6cdd89

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

drivers/firewire/core-device.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ static int textual_leaf_to_string(const u32 *block, char *buf, size_t size)
118118
* @buf: where to put the string
119119
* @size: size of @buf, in bytes
120120
*
121-
* The string is taken from a minimal ASCII text descriptor leaf after
122-
* the immediate entry with @key. The string is zero-terminated.
123-
* An overlong string is silently truncated such that it and the
124-
* zero byte fit into @size.
121+
* The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
122+
* @key. The string is zero-terminated. An overlong string is silently truncated such that it
123+
* and the zero byte fit into @size.
125124
*
126125
* Returns strlen(buf) or a negative error code.
127126
*/
@@ -368,8 +367,17 @@ static ssize_t show_text_leaf(struct device *dev,
368367
for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) {
369368
int result = fw_csr_string(directories[i], attr->key, buf, bufsize);
370369
// Detected.
371-
if (result >= 0)
370+
if (result >= 0) {
372371
ret = result;
372+
} else if (i == 0 && attr->key == CSR_VENDOR) {
373+
// Sony DVMC-DA1 has configuration ROM such that the descriptor leaf entry
374+
// in the root directory follows to the directory entry for vendor ID
375+
// instead of the immediate value for vendor ID.
376+
result = fw_csr_string(directories[i], CSR_DIRECTORY | attr->key, buf,
377+
bufsize);
378+
if (result >= 0)
379+
ret = result;
380+
}
373381
}
374382

375383
if (ret >= 0) {

0 commit comments

Comments
 (0)