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

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-pl022.c

index c13d523..5e30110 100644 (file)
@@ -2225,7 +2225,7 @@ static int pl022_probe(struct amba_device *adev, const struct amba_id *id)
 
        /* Register with the SPI framework */
        amba_set_drvdata(adev, pl022);
-       status = spi_register_master(master);
+       status = devm_spi_register_master(&adev->dev, master);
        if (status != 0) {
                dev_err(&adev->dev,
                        "probe - problem registering spi master\n");
@@ -2285,7 +2285,6 @@ pl022_remove(struct amba_device *adev)
        clk_unprepare(pl022->clk);
        amba_release_regions(adev);
        tasklet_disable(&pl022->pump_transfers);
-       spi_unregister_master(pl022->master);
        return 0;
 }