spi: falcon: switch to managed controller allocation

Switch to device managed controller allocation for consistency and to
simplify error handling.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260511150408.796155-5-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Johan Hovold 2026-05-11 17:04:00 +02:00 committed by Mark Brown
parent ee9575d2b3
commit 864c368199
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -392,9 +392,8 @@ static int falcon_sflash_probe(struct platform_device *pdev)
{
struct falcon_sflash *priv;
struct spi_controller *host;
int ret;
host = spi_alloc_host(&pdev->dev, sizeof(*priv));
host = devm_spi_alloc_host(&pdev->dev, sizeof(*priv));
if (!host)
return -ENOMEM;
@ -406,10 +405,7 @@ static int falcon_sflash_probe(struct platform_device *pdev)
host->setup = falcon_sflash_setup;
host->transfer_one_message = falcon_sflash_xfer_one;
ret = devm_spi_register_controller(&pdev->dev, host);
if (ret)
spi_controller_put(host);
return ret;
return devm_spi_register_controller(&pdev->dev, host);
}
static const struct of_device_id falcon_sflash_match[] = {