mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-03 17:14:14 +08:00
PCI: endpoint: Make ->remove() callback optional
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>
This commit is contained in:
parent
f01f969e25
commit
28daeff669
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user