spi: omap2-mcspi: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:40:29 +0000 (13:40 +0900)
committerMark Brown <broonie@linaro.org>
Thu, 26 Sep 2013 10:42:36 +0000 (11:42 +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-omap2-mcspi.c

index ed4af47..2f7fd35 100644 (file)
@@ -1407,7 +1407,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
        if (status < 0)
                goto disable_pm;
 
-       status = spi_register_master(master);
+       status = devm_spi_register_master(&pdev->dev, master);
        if (status < 0)
                goto disable_pm;
 
@@ -1435,7 +1435,6 @@ static int omap2_mcspi_remove(struct platform_device *pdev)
        pm_runtime_put_sync(mcspi->dev);
        pm_runtime_disable(&pdev->dev);
 
-       spi_unregister_master(master);
        kfree(dma_channels);
 
        return 0;