Skip to content

Commit 001ffe1

Browse files
author
Alexander Antonov
committed
Fix issue on GNR with skipping IAX
1 parent 6352553 commit 001ffe1

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

src/pcm-iio-pmu.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,28 +1194,20 @@ bool BirchStreamPlatform::birchStreamAcceleratorStackProbe(int unit, const struc
11941194
return false;
11951195
};
11961196

1197-
{
1197+
auto add_pci_part = [&](int domainno, int busno, int devno, int part_number) {
11981198
struct iio_bifurcated_part part;
1199-
if (process_pci_dev(address.domainno, address.busno, 1, SRF_DSA_IAX_PART_NUMBER, part) ||
1200-
process_pci_dev(address.domainno, address.busno, 2, SRF_DSA_IAX_PART_NUMBER, part)) {
1199+
if (process_pci_dev(domainno, busno, devno, part_number, part)) {
12011200
stack.parts.push_back(part);
12021201
}
1203-
}
1202+
};
12041203

1205-
{
1206-
struct iio_bifurcated_part part;
1207-
if (process_pci_dev(address.domainno, address.busno + 1, 0, SRF_QAT_PART_NUMBER, part)) {
1208-
stack.parts.push_back(part);
1209-
}
1210-
}
1204+
add_pci_part(address.domainno, address.busno, 1, SRF_DSA_IAX_PART_NUMBER);
1205+
add_pci_part(address.domainno, address.busno, 2, SRF_DSA_IAX_PART_NUMBER);
12111206

1212-
{
1213-
/* Bus number for HQM is higher on 3 than DSA bus number */
1214-
struct iio_bifurcated_part part;
1215-
if (process_pci_dev(address.domainno, address.busno + 3, 0, SRF_HQM_PART_NUMBER, part)) {
1216-
stack.parts.push_back(part);
1217-
}
1218-
}
1207+
add_pci_part(address.domainno, address.busno + 1, 0, SRF_QAT_PART_NUMBER);
1208+
1209+
/* Bus number for HQM is higher on 3 than DSA bus number */
1210+
add_pci_part(address.domainno, address.busno + 3, 0, SRF_HQM_PART_NUMBER);
12191211

12201212
if (!stack.parts.empty()) {
12211213
iio_on_socket.stacks.push_back(stack);

0 commit comments

Comments
 (0)