From aa3568f35325f476ba7b10b885aea2a1a158d61b Mon Sep 17 00:00:00 2001 From: lipengfei28 Date: Tue, 23 Jul 2024 15:31:33 +0800 Subject: [PATCH] pci epf use epc_node link to epc Signed-off-by: lipengfei28 --- drivers/pci/pci_epc.c | 10 +++++----- drivers/pci/pci_epf.c | 2 +- include/nuttx/pci/pci_epf.h | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/pci/pci_epc.c b/drivers/pci/pci_epc.c index ee495cc5d6852..e1949b94e0a94 100644 --- a/drivers/pci/pci_epc.c +++ b/drivers/pci/pci_epc.c @@ -732,7 +732,7 @@ int pci_epc_add_epf(FAR struct pci_epc_ctrl_s *epc, epf->funcno = funcno; epf->epc = epc; - list_add_tail(&epc->epf, &epf->node); + list_add_tail(&epc->epf, &epf->epc_node); out: nxmutex_unlock(&epc->lock); @@ -798,7 +798,7 @@ void pci_epc_linkup(FAR struct pci_epc_ctrl_s *epc) } nxmutex_lock(&epc->lock); - list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node) + list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node) { nxmutex_lock(&epf->lock); if (epf->event_ops && epf->event_ops->link_up) @@ -839,7 +839,7 @@ void pci_epc_linkdown(FAR struct pci_epc_ctrl_s *epc) } nxmutex_lock(&epc->lock); - list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node) + list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node) { nxmutex_lock(&epf->lock); if (epf->event_ops && epf->event_ops->link_down) @@ -880,7 +880,7 @@ void pci_epc_init_notify(FAR struct pci_epc_ctrl_s *epc) } nxmutex_lock(&epc->lock); - list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node) + list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node) { nxmutex_lock(&epf->lock); if (epf->event_ops && epf->event_ops->core_init) @@ -921,7 +921,7 @@ void pci_epc_bme_notify(FAR struct pci_epc_ctrl_s *epc) } nxmutex_lock(&epc->lock); - list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, node) + list_for_every_entry(&epc->epf, epf, struct pci_epf_device_s, epc_node) { nxmutex_lock(&epf->lock); if (epf->event_ops && epf->event_ops->bme) diff --git a/drivers/pci/pci_epf.c b/drivers/pci/pci_epf.c index 3056030c1be36..8b9ba80a5fcf4 100644 --- a/drivers/pci/pci_epf.c +++ b/drivers/pci/pci_epf.c @@ -448,7 +448,7 @@ int pci_epf_register_driver(FAR struct pci_epf_driver_s *drv) continue; } - epc = pci_get_epc(epf->name); + epc = pci_get_epc(epf->epc_name); if (epc == NULL) { ret = -ENODEV; diff --git a/include/nuttx/pci/pci_epf.h b/include/nuttx/pci/pci_epf.h index 307580b8f6de5..6e2917b4c6bb9 100644 --- a/include/nuttx/pci/pci_epf.h +++ b/include/nuttx/pci/pci_epf.h @@ -128,6 +128,7 @@ struct pci_epf_device_s FAR struct pci_epf_driver_s *driver; FAR const struct pci_epf_device_id_s *id; struct list_node node; + struct list_node epc_node; /* Mutex to protect against concurrent access of pci_epf_ops_s */