mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
spi: falcon: 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-5-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
ee9575d2b3
commit
864c368199
|
|
@ -392,9 +392,8 @@ static int falcon_sflash_probe(struct platform_device *pdev)
|
|||
{
|
||||
struct falcon_sflash *priv;
|
||||
struct spi_controller *host;
|
||||
int ret;
|
||||
|
||||
host = spi_alloc_host(&pdev->dev, sizeof(*priv));
|
||||
host = devm_spi_alloc_host(&pdev->dev, sizeof(*priv));
|
||||
if (!host)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -406,10 +405,7 @@ static int falcon_sflash_probe(struct platform_device *pdev)
|
|||
host->setup = falcon_sflash_setup;
|
||||
host->transfer_one_message = falcon_sflash_xfer_one;
|
||||
|
||||
ret = devm_spi_register_controller(&pdev->dev, host);
|
||||
if (ret)
|
||||
spi_controller_put(host);
|
||||
return ret;
|
||||
return devm_spi_register_controller(&pdev->dev, host);
|
||||
}
|
||||
|
||||
static const struct of_device_id falcon_sflash_match[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user