Skip to content

Commit dde0a31

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
PCI: endpoint: Make struct pci_epf_driver::remove return void
The driver core ignores the return value of pci_epf_device_remove() (because there is only little it can do when a device disappears) and there are no pci_epf_drivers with a remove callback. So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Acked-by: Kishon Vijay Abraham I <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2734d6c commit dde0a31

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,14 @@ static int pci_epf_device_probe(struct device *dev)
389389

390390
static int pci_epf_device_remove(struct device *dev)
391391
{
392-
int ret = 0;
393392
struct pci_epf *epf = to_pci_epf(dev);
394393
struct pci_epf_driver *driver = to_pci_epf_driver(dev->driver);
395394

396395
if (driver->remove)
397-
ret = driver->remove(epf);
396+
driver->remove(epf);
398397
epf->driver = NULL;
399398

400-
return ret;
399+
return 0;
401400
}
402401

403402
static struct bus_type pci_epf_bus_type = {

include/linux/pci-epf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct pci_epf_ops {
8585
*/
8686
struct pci_epf_driver {
8787
int (*probe)(struct pci_epf *epf);
88-
int (*remove)(struct pci_epf *epf);
88+
void (*remove)(struct pci_epf *epf);
8989

9090
struct device_driver driver;
9191
struct pci_epf_ops *ops;

0 commit comments

Comments
 (0)