spi: xlp: 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-13-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Johan Hovold
2026-05-11 17:04:08 +02:00
committed by Mark Brown
parent 60db555fca
commit f3d1dc0bc6

View File

@@ -398,7 +398,7 @@ static int xlp_spi_probe(struct platform_device *pdev)
xspi->spi_clk = clk_get_rate(clk);
host = spi_alloc_host(&pdev->dev, 0);
host = devm_spi_alloc_host(&pdev->dev, 0);
if (!host) {
dev_err(&pdev->dev, "could not alloc host\n");
return -ENOMEM;
@@ -418,7 +418,6 @@ static int xlp_spi_probe(struct platform_device *pdev)
err = devm_spi_register_controller(&pdev->dev, host);
if (err) {
dev_err(&pdev->dev, "spi register host failed!\n");
spi_controller_put(host);
return err;
}