From: Kishon Vijay Abraham I Date: Fri, 18 Aug 2017 14:57:55 +0000 (+0530) Subject: PCI: endpoint: Make ->remove() callback optional X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=28daeff66990db85022c6a8b410e5b78dc78ff6a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Bjorn Helgaas --- diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index f14e2be52658..70eccc04ee7f 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -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;