@@ -1194,28 +1194,20 @@ bool BirchStreamPlatform::birchStreamAcceleratorStackProbe(int unit, const struc
1194
1194
return false ;
1195
1195
};
1196
1196
1197
- {
1197
+ auto add_pci_part = [&]( int domainno, int busno, int devno, int part_number) {
1198
1198
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)) {
1201
1200
stack.parts .push_back (part);
1202
1201
}
1203
- }
1202
+ };
1204
1203
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);
1211
1206
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);
1219
1211
1220
1212
if (!stack.parts .empty ()) {
1221
1213
iio_on_socket.stacks .push_back (stack);
0 commit comments