mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
spi: fsi: 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-6-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
864c368199
commit
c087eb4603
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user