diff --git a/drivers/spi/spi-xlp.c b/drivers/spi/spi-xlp.c index be8bbe1cbba3..d014955e6d4b 100644 --- a/drivers/spi/spi-xlp.c +++ b/drivers/spi/spi-xlp.c @@ -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; }