]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: fsi: switch to managed controller allocation
authorJohan Hovold <johan@kernel.org>
Mon, 11 May 2026 15:04:01 +0000 (17:04 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 18 May 2026 09:19:45 +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-6-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsi.c

index f6a75f0184c4c6e90a13fce18c5de9a5576c0758..451cb4cfdb9c999dcb42d4e8ed12b889b56034bf 100644 (file)
@@ -554,7 +554,7 @@ static int fsi_spi_probe(struct fsi_device *fsi)
                if (of_property_read_u32(np, "reg", &base))
                        continue;
 
-               ctlr = spi_alloc_host(dev, sizeof(*ctx));
+               ctlr = devm_spi_alloc_host(dev, sizeof(*ctx));
                if (!ctlr)
                        break;
 
@@ -571,9 +571,9 @@ static int fsi_spi_probe(struct fsi_device *fsi)
 
                rc = devm_spi_register_controller(dev, ctlr);
                if (rc)
-                       spi_controller_put(ctlr);
-               else
-                       num_controllers_registered++;
+                       continue;
+
+               num_controllers_registered++;
        }
 
        if (!num_controllers_registered)