Skip to content

Commit

Permalink
PCI: endpoint: Make ->remove() callback optional
Browse files Browse the repository at this point in the history
Make ->remove() callback optional so that endpoint function drivers don't
have to populate empty ->remove() callback functions.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Kishon Vijay Abraham I authored and Bjorn Helgaas committed Aug 29, 2017
1 parent f01f969 commit 28daeff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/pci/endpoint/pci-epf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ static int pci_epf_device_probe(struct device *dev)

static int pci_epf_device_remove(struct device *dev)
{
int ret;
int ret = 0;
struct pci_epf *epf = to_pci_epf(dev);
struct pci_epf_driver *driver = to_pci_epf_driver(dev->driver);

ret = driver->remove(epf);
if (driver->remove)
ret = driver->remove(epf);
epf->driver = NULL;

return ret;
Expand Down

0 comments on commit 28daeff

Please sign in to comment.