spi: rcar: Use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Wed, 4 Dec 2013 05:13:50 +0000 (14:13 +0900)
committerMark Brown <broonie@linaro.org>
Mon, 9 Dec 2013 17:59:58 +0000 (17:59 +0000)
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-rspi.c

index 19c65c43cbc52b7d2db0fb45568acd9869901f6e..cfdbb422a40a9283b7e1a1200811dd5c2ff037fb 100644 (file)
@@ -887,7 +887,6 @@ static int rspi_remove(struct platform_device *pdev)
 {
        struct rspi_data *rspi = platform_get_drvdata(pdev);
 
-       spi_unregister_master(rspi->master);
        rspi_release_dma(rspi);
 
        return 0;
@@ -972,7 +971,7 @@ static int rspi_probe(struct platform_device *pdev)
                goto error2;
        }
 
-       ret = spi_register_master(master);
+       ret = devm_spi_register_master(&pdev->dev, master);
        if (ret < 0) {
                dev_err(&pdev->dev, "spi_register_master error.\n");
                goto error2;