File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -596,8 +596,7 @@ const struct rt_pci_device_id *rt_pci_match_ids(struct rt_pci_device *pdev,
596
596
597
597
rt_err_t rt_pci_driver_register (struct rt_pci_driver * pdrv );
598
598
rt_err_t rt_pci_device_register (struct rt_pci_device * pdev );
599
- struct rt_pci_bus_resource * rt_pci_find_bar (struct rt_pci_device * pdev ,rt_ubase_t flags );
600
-
599
+ struct rt_pci_bus_resource * rt_pci_find_bar (struct rt_pci_device * pdev ,rt_ubase_t flags ,int index );
601
600
#define RT_PCI_DRIVER_EXPORT (driver ) RT_DRIVER_EXPORT(driver, pci, BUILIN)
602
601
603
602
extern struct rt_spinlock rt_pci_lock ;
Original file line number Diff line number Diff line change @@ -712,12 +712,16 @@ rt_err_t rt_pci_device_alloc_resource(struct rt_pci_host_bridge *host_bridge,
712
712
return err ;
713
713
}
714
714
715
- struct rt_pci_bus_resource * rt_pci_find_bar (struct rt_pci_device * pdev ,rt_ubase_t flags )
715
+ struct rt_pci_bus_resource * rt_pci_find_bar (struct rt_pci_device * pdev ,rt_ubase_t flags , int index )
716
716
{
717
717
for (int i = 0 ; i < RT_PCI_BAR_NR_MAX ; i ++ )
718
718
{
719
719
if (pdev -> resource [i ].flags == flags )
720
- return & pdev -> resource [i ];
720
+ {
721
+ index -- ;
722
+ if (index == 0 )
723
+ return & pdev -> resource [i ];
724
+ }
721
725
}
722
726
return RT_NULL ;
723
727
}
You can’t perform that action at this time.
0 commit comments