Skip to content

Commit 22a0117

Browse files
zijun-hukwilczynski
authored andcommitted
PCI: endpoint: Remove unused devm_pci_epc_destroy()
The static function devm_pci_epc_match() is only invoked within the devm_pci_epc_destroy(). However, since it was initially introduced, this new API has had no callers. Thus, remove both the unused API and the static function. Reviewed-by: Manivannan Sadhasivam <[email protected]> Signed-off-by: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Manivannan Sadhasivam <[email protected]> [kwilczynski: commit log] Signed-off-by: Krzysztof Wilczyński <[email protected]>
1 parent aba2b17 commit 22a0117

File tree

3 files changed

+3
-30
lines changed

3 files changed

+3
-30
lines changed

Documentation/PCI/endpoint/pci-endpoint.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,10 @@ by the PCI controller driver.
5757
The PCI controller driver can then create a new EPC device by invoking
5858
devm_pci_epc_create()/pci_epc_create().
5959

60-
* devm_pci_epc_destroy()/pci_epc_destroy()
60+
* pci_epc_destroy()
6161

62-
The PCI controller driver can destroy the EPC device created by either
63-
devm_pci_epc_create() or pci_epc_create() using devm_pci_epc_destroy() or
64-
pci_epc_destroy().
62+
The PCI controller driver can destroy the EPC device created by
63+
pci_epc_create() using pci_epc_destroy().
6564

6665
* pci_epc_linkup()
6766

drivers/pci/endpoint/pci-epc-core.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ static void devm_pci_epc_release(struct device *dev, void *res)
2525
pci_epc_destroy(epc);
2626
}
2727

28-
static int devm_pci_epc_match(struct device *dev, void *res, void *match_data)
29-
{
30-
struct pci_epc **epc = res;
31-
32-
return *epc == match_data;
33-
}
34-
3528
/**
3629
* pci_epc_put() - release the PCI endpoint controller
3730
* @epc: epc returned by pci_epc_get()
@@ -962,24 +955,6 @@ void pci_epc_destroy(struct pci_epc *epc)
962955
}
963956
EXPORT_SYMBOL_GPL(pci_epc_destroy);
964957

965-
/**
966-
* devm_pci_epc_destroy() - destroy the EPC device
967-
* @dev: device that wants to destroy the EPC
968-
* @epc: the EPC device that has to be destroyed
969-
*
970-
* Invoke to destroy the devres associated with this
971-
* pci_epc and destroy the EPC device.
972-
*/
973-
void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc)
974-
{
975-
int r;
976-
977-
r = devres_release(dev, devm_pci_epc_release, devm_pci_epc_match,
978-
epc);
979-
dev_WARN_ONCE(dev, r, "couldn't find PCI EPC resource\n");
980-
}
981-
EXPORT_SYMBOL_GPL(devm_pci_epc_destroy);
982-
983958
static void pci_epc_release(struct device *dev)
984959
{
985960
kfree(to_pci_epc(dev));

include/linux/pci-epc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ __devm_pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
261261
struct pci_epc *
262262
__pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
263263
struct module *owner);
264-
void devm_pci_epc_destroy(struct device *dev, struct pci_epc *epc);
265264
void pci_epc_destroy(struct pci_epc *epc);
266265
int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
267266
enum pci_epc_interface_type type);

0 commit comments

Comments
 (0)