[PATCH 3/8] PCI: endpoint: Add an API for unregistering the EPF notifier

From: Manivannan Sadhasivam
Date: Mon May 02 2022 - 02:07:02 EST


Add "pci_epc_unregister_notifier()" to unregister the notifier added
between EPC and EPF.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
---
include/linux/pci-epc.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
index a48778e1a4ee..c414a08bfd67 100644
--- a/include/linux/pci-epc.h
+++ b/include/linux/pci-epc.h
@@ -198,6 +198,12 @@ pci_epc_register_notifier(struct pci_epc *epc, struct notifier_block *nb)
return atomic_notifier_chain_register(&epc->notifier, nb);
}

+static inline int
+pci_epc_unregister_notifier(struct pci_epc *epc, struct notifier_block *nb)
+{
+ return atomic_notifier_chain_unregister(&epc->notifier, nb);
+}
+
struct pci_epc *
__devm_pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
struct module *owner);
--
2.25.1