summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/device-attribute-test.c
diff options
context:
space:
mode:
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>2023-12-25 07:23:01 +0900
committerTakashi Sakamoto <o-takashi@sakamocchi.jp>2024-01-08 09:36:56 +0900
commit2eab8bc0f0c80ddb8c7d8192ff6f13c2bc505739 (patch)
treef112d579da23d1889315c5106b0d675e4085ca8c /drivers/firewire/device-attribute-test.c
parentb6a38057d06e282c1a4630db1d7b74548664a1d7 (diff)
downloadlinux-2eab8bc0f0c80ddb8c7d8192ff6f13c2bc505739.tar.gz
linux-2eab8bc0f0c80ddb8c7d8192ff6f13c2bc505739.tar.bz2
linux-2eab8bc0f0c80ddb8c7d8192ff6f13c2bc505739.zip
firewire: core: detect model name for legacy layout of configuration ROM
As the part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well as root directory when showing device attribute for node device. This change expects 'model_name' attribute appears in node device, however it is probable to see the other types of descriptor leaf if the vendor directory includes. Suggested-by: Adam Goldman <adamg@pobox.com> Link: https://lore.kernel.org/r/20231221134849.603857-8-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Diffstat (limited to 'drivers/firewire/device-attribute-test.c')
-rw-r--r--drivers/firewire/device-attribute-test.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firewire/device-attribute-test.c b/drivers/firewire/device-attribute-test.c
index 689115433425..da2a4a09bf84 100644
--- a/drivers/firewire/device-attribute-test.c
+++ b/drivers/firewire/device-attribute-test.c
@@ -206,8 +206,9 @@ static void device_attr_legacy_avc(struct kunit *test)
// Descriptor leaf entry for vendor is not found.
KUNIT_EXPECT_LT(test, show_text_leaf(node_dev, &config_rom_attributes[5].attr, buf), 0);
- // Descriptor leaf entry for model is not found.
- KUNIT_EXPECT_LT(test, show_text_leaf(node_dev, &config_rom_attributes[6].attr, buf), 0);
+ // Descriptor leaf entry for model is found.
+ KUNIT_EXPECT_GT(test, show_text_leaf(node_dev, &config_rom_attributes[6].attr, buf), 0);
+ KUNIT_EXPECT_STREQ(test, buf, "ABCDEFGHIJ\n");
// For entries in unit 0 directory.