spi: axi-spi-engine: use devm_spi_register_controller()

This replaces spi_register_controller() with
devm_spi_register_controller() in the AXI SPI Engine driver. This
saves us from having to call spi_unregister_controller() in the
remove function.

The remove function is also removed since it is no longer needed.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231117-axi-spi-engine-series-1-v1-7-cc59db999b87@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
David Lechner 2023-11-17 14:12:58 -06:00 committed by Mark Brown
parent 076f32d5db
commit e16e71e3f3
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -532,7 +532,7 @@ static int spi_engine_probe(struct platform_device *pdev)
host->transfer_one_message = spi_engine_transfer_one_message;
host->num_chipselect = 8;
ret = spi_register_controller(host);
ret = devm_spi_register_controller(&pdev->dev, host);
if (ret)
return ret;
@ -541,13 +541,6 @@ static int spi_engine_probe(struct platform_device *pdev)
return 0;
}
static void spi_engine_remove(struct platform_device *pdev)
{
struct spi_controller *host = platform_get_drvdata(pdev);
spi_unregister_controller(host);
}
static const struct of_device_id spi_engine_match_table[] = {
{ .compatible = "adi,axi-spi-engine-1.00.a" },
{ },
@ -556,7 +549,6 @@ MODULE_DEVICE_TABLE(of, spi_engine_match_table);
static struct platform_driver spi_engine_driver = {
.probe = spi_engine_probe,
.remove_new = spi_engine_remove,
.driver = {
.name = "spi-engine",
.of_match_table = spi_engine_match_table,