From 43eb0a4a00c35f90419cfd5e295516e80d2d32fd Mon Sep 17 00:00:00 2001 From: zhujiale <945386260@qq.com> Date: Sat, 14 Sep 2024 13:19:23 +0800 Subject: [PATCH] pci --- components/drivers/pci/pci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/drivers/pci/pci.c b/components/drivers/pci/pci.c index 19c9994ca88e..ca5a4abe9db9 100644 --- a/components/drivers/pci/pci.c +++ b/components/drivers/pci/pci.c @@ -712,14 +712,14 @@ rt_err_t rt_pci_device_alloc_resource(struct rt_pci_host_bridge *host_bridge, return err; } -rt_ubase_t rt_pci_get_addr(struct rt_pci_device *pdev, rt_ubase_t flags) +struct rt_pci_bus_resource *rt_pci_get_addr(struct rt_pci_device* pdev,rt_ubase_t flags) { for (int i = 0; i < RT_PCI_BAR_NR_MAX; i++) { if (pdev->resource[i].flags == flags) - return (rt_ubase_t)rt_ioremap((void *)pdev->resource[i].base, pdev->resource[i].size); + return &pdev->resource[i]; } - return 0; + return RT_NULL; } void rt_pci_enum_device(struct rt_pci_bus *bus,