spi: tegra20-sflash: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:50:25 +0000 (13:50 +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-tegra20-sflash.c

index 1d814dc6e0000c7743b6844db332f46a6516389c..a68d7797a8ec595a7d96747d546b9ce121f347f1 100644 (file)
@@ -529,7 +529,7 @@ static int tegra_sflash_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;
@@ -553,7 +553,6 @@ static int tegra_sflash_remove(struct platform_device *pdev)
        struct tegra_sflash_data        *tsd = spi_master_get_devdata(master);
 
        free_irq(tsd->irq, tsd);
-       spi_unregister_master(master);
 
        pm_runtime_disable(&pdev->dev);
        if (!pm_runtime_status_suspended(&pdev->dev))