]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: xlp: switch to managed controller allocation
authorJohan Hovold <johan@kernel.org>
Mon, 11 May 2026 15:04:08 +0000 (17:04 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 18 May 2026 09:19:52 +0000 (10:19 +0100)
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>
drivers/spi/spi-xlp.c

index be8bbe1cbba317cb9166e48a3d37ff01792d7550..d014955e6d4b38f658d265b95fd8de78bef0a281 100644 (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;
        }