Unverified Commit b082694f authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Mark Brown
Browse files

spi: topcliff-pch: 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.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230303172041.2103336-83-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 001ea026
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1396,7 +1396,7 @@ static int pch_spi_pd_probe(struct platform_device *plat_dev)
	return ret;
}

static int pch_spi_pd_remove(struct platform_device *plat_dev)
static void pch_spi_pd_remove(struct platform_device *plat_dev)
{
	struct pch_spi_board_data *board_dat = dev_get_platdata(&plat_dev->dev);
	struct pch_spi_data *data = platform_get_drvdata(plat_dev);
@@ -1434,8 +1434,6 @@ static int pch_spi_pd_remove(struct platform_device *plat_dev)

	pci_iounmap(board_dat->pdev, data->io_remap_addr);
	spi_unregister_master(data->master);

	return 0;
}
#ifdef CONFIG_PM
static int pch_spi_pd_suspend(struct platform_device *pd_dev,
@@ -1516,7 +1514,7 @@ static struct platform_driver pch_spi_pd_driver = {
		.name = "pch-spi",
	},
	.probe = pch_spi_pd_probe,
	.remove = pch_spi_pd_remove,
	.remove_new = pch_spi_pd_remove,
	.suspend = pch_spi_pd_suspend,
	.resume = pch_spi_pd_resume
};