]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: mpc512x: use devm_spi_register_master()
authorJingoo Han <jg1.han@samsung.com>
Tue, 24 Sep 2013 04:31:50 +0000 (13:31 +0900)
committerMark Brown <broonie@linaro.org>
Thu, 26 Sep 2013 10:42:33 +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-mpc512x-psc.c

index dbc5e999a1f5689c1a526ace9f3dc4061f924223..b4426dd8a0c3a18dea945c9e63f0410cb5c0dee9 100644 (file)
@@ -534,7 +534,7 @@ static int mpc512x_psc_spi_do_probe(struct device *dev, u32 regaddr,
        if (ret < 0)
                goto free_clock;
 
-       ret = spi_register_master(master);
+       ret = devm_spi_register_master(dev, master);
        if (ret < 0)
                goto free_clock;
 
@@ -557,12 +557,10 @@ static int mpc512x_psc_spi_do_remove(struct device *dev)
        struct spi_master *master = spi_master_get(dev_get_drvdata(dev));
        struct mpc512x_psc_spi *mps = spi_master_get_devdata(master);
 
-       spi_unregister_master(master);
        clk_disable_unprepare(mps->clk_mclk);
        free_irq(mps->irq, mps);
        if (mps->psc)
                iounmap(mps->psc);
-       spi_master_put(master);
 
        return 0;
 }