firewire fixes for 6.8-rc3

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 pull request includes some changes to
 handle the quirk.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQQE66IEYNDXNBPeGKSsLtaWM8LwEwUCZbuIzgAKCRCsLtaWM8Lw
 Ew+VAP9S5PXLBKaO4szSvKriwL6C+vY1y6Y8HAN1nUZigEqjyAD/Y8ztremGsIdK
 J3k1sYwPRdgEI7WYis9qa56x/Z1stwQ=
 =xUU1
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-02-01 10:12:53 -08:00
commit f6cdd897cc

View File

@ -118,10 +118,9 @@ static int textual_leaf_to_string(const u32 *block, char *buf, size_t size)
* @buf: where to put the string * @buf: where to put the string
* @size: size of @buf, in bytes * @size: size of @buf, in bytes
* *
* The string is taken from a minimal ASCII text descriptor leaf after * The string is taken from a minimal ASCII text descriptor leaf just after the entry with the
* the immediate entry with @key. The string is zero-terminated. * @key. The string is zero-terminated. An overlong string is silently truncated such that it
* An overlong string is silently truncated such that it and the * and the zero byte fit into @size.
* zero byte fit into @size.
* *
* Returns strlen(buf) or a negative error code. * Returns strlen(buf) or a negative error code.
*/ */
@ -368,8 +367,17 @@ static ssize_t show_text_leaf(struct device *dev,
for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) { for (i = 0; i < ARRAY_SIZE(directories) && !!directories[i]; ++i) {
int result = fw_csr_string(directories[i], attr->key, buf, bufsize); int result = fw_csr_string(directories[i], attr->key, buf, bufsize);
// Detected. // Detected.
if (result >= 0) if (result >= 0) {
ret = result; ret = result;
} else if (i == 0 && attr->key == CSR_VENDOR) {
// Sony DVMC-DA1 has configuration ROM such that the descriptor leaf entry
// in the root directory follows to the directory entry for vendor ID
// instead of the immediate value for vendor ID.
result = fw_csr_string(directories[i], CSR_DIRECTORY | attr->key, buf,
bufsize);
if (result >= 0)
ret = result;
}
} }
if (ret >= 0) { if (ret >= 0) {