spi: tegra114: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:49:24 +0000 (13:49 +0900)
committerMark Brown <broonie@linaro.org>
Thu, 26 Sep 2013 10:43:07 +0000 (11:43 +0100)
Use devm_spi_register_master() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-tegra114.c

index 145dd435483b2d12e304ce3bb46f97a2f4baab4e..bb3a19f2ed390dd75de8a128ffcd4297dcd2bce5 100644 (file)
@@ -1115,7 +1115,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
        pm_runtime_put(&pdev->dev);
 
        master->dev.of_node = pdev->dev.of_node;
-       ret = spi_register_master(master);
+       ret = devm_spi_register_master(&pdev->dev, master);
        if (ret < 0) {
                dev_err(&pdev->dev, "can not register to master err %d\n", ret);
                goto exit_pm_disable;
@@ -1142,7 +1142,6 @@ static int tegra_spi_remove(struct platform_device *pdev)
        struct tegra_spi_data   *tspi = spi_master_get_devdata(master);
 
        free_irq(tspi->irq, tspi);
-       spi_unregister_master(master);
 
        if (tspi->tx_dma_chan)
                tegra_spi_deinit_dma_param(tspi, false);