PCI: host-generic: Convert to platform remove callback returning void
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 20 Oct 2023 09:21:07 +0000 (11:21 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 20 Nov 2023 21:53:14 +0000 (15:53 -0600)
commitd9dcdb4531fe39ce48919ef8c2c9369ee49f3ad2
tree7284a0dedf376e30e8dfc2f33697b204a68a0f75
parentb85ea95d086471afb4ad062012a4d73cd328fa86
PCI: host-generic: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code.  However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

pci_host_common_remove() returned zero unconditionally. With that converted
to return void instead, the generic pci host driver can be switched to
.remove_new() trivially.

Link: https://lore.kernel.org/r/20231020092107.2148311-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Will Deacon <will@kernel.org>
drivers/pci/controller/pci-host-common.c
drivers/pci/controller/pci-host-generic.c
include/linux/pci-ecam.h