mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user