Skip to content

Commit

Permalink
PCI: endpoint: Remove the ->remove() callback
Browse files Browse the repository at this point in the history
epf_test is allocated using devm_kzalloc(). Hence it's not required to
explicitly free it in remove() callback. Since ->remove() callback doesn't
do anything other than freeing epf_test, remove the ->remove() callback.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Shawn Lin authored and Bjorn Helgaas committed Aug 29, 2017
1 parent 702a3ed commit 2ca93ff
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions drivers/pci/endpoint/functions/pci-epf-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,6 @@ static int pci_epf_test_probe(struct pci_epf *epf)
return 0;
}

static int pci_epf_test_remove(struct pci_epf *epf)
{
struct pci_epf_test *epf_test = epf_get_drvdata(epf);

kfree(epf_test);
return 0;
}

static struct pci_epf_ops ops = {
.unbind = pci_epf_test_unbind,
.bind = pci_epf_test_bind,
Expand All @@ -513,7 +505,6 @@ static struct pci_epf_ops ops = {
static struct pci_epf_driver test_driver = {
.driver.name = "pci_epf_test",
.probe = pci_epf_test_probe,
.remove = pci_epf_test_remove,
.id_table = pci_epf_test_ids,
.ops = &ops,
.owner = THIS_MODULE,
Expand Down

0 comments on commit 2ca93ff

Please sign in to comment.