Commit 9e4ce522 authored by David Lechner's avatar David Lechner Committed by Mark Brown

spi: axi-spi-engine: simplify driver data allocation

This simplifies the private data allocation in the AXI SPI Engine driver
by making use of the feature built into the spi_alloc_host() function
instead of doing it manually.
Signed-off-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20231117-axi-spi-engine-series-1-v1-3-cc59db999b87@baylibre.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 68539d18
......@@ -473,15 +473,11 @@ static int spi_engine_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
spi_engine = devm_kzalloc(&pdev->dev, sizeof(*spi_engine), GFP_KERNEL);
if (!spi_engine)
return -ENOMEM;
host = spi_alloc_host(&pdev->dev, 0);
host = spi_alloc_host(&pdev->dev, sizeof(*spi_engine));
if (!host)
return -ENOMEM;
spi_controller_set_devdata(host, spi_engine);
spi_engine = spi_controller_get_devdata(host);
spin_lock_init(&spi_engine->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment