mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
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:
parent
60db555fca
commit
f3d1dc0bc6
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user