]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: mxs: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:32:56 +0000 (13:32 +0900)
committerMark Brown <broonie@linaro.org>
Thu, 26 Sep 2013 10:42:34 +0000 (11:42 +0100)
Use devm_spi_register_master() to make cleanup paths simpler,
and remove a duplicate put.

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

index de7b1141b90f5b741f3fc7fcbcdfc197fce5260b..312c7f99c4a77a94cdccdc4fda6608a6c6a23ed4 100644 (file)
@@ -571,7 +571,7 @@ static int mxs_spi_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, master);
 
-       ret = spi_register_master(master);
+       ret = devm_spi_register_master(&pdev->dev, master);
        if (ret) {
                dev_err(&pdev->dev, "Cannot register SPI master, %d\n", ret);
                goto out_disable_clk;
@@ -598,10 +598,8 @@ static int mxs_spi_remove(struct platform_device *pdev)
        spi = spi_master_get_devdata(master);
        ssp = &spi->ssp;
 
-       spi_unregister_master(master);
        clk_disable_unprepare(ssp->clk);
        dma_release_channel(ssp->dmach);
-       spi_master_put(master);
 
        return 0;
 }