mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
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:
parent
076f32d5db
commit
e16e71e3f3
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user