From: Jingoo Han Date: Tue, 24 Sep 2013 04:31:50 +0000 (+0900) Subject: spi: mpc512x: use devm_spi_register_master() X-Git-Tag: v3.13-rc1~123^2~9^2^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaa24297846bcdd98cefd52937ed88046a121ebc;p=kernel%2Fkernel-generic.git spi: mpc512x: use devm_spi_register_master() Use devm_spi_register_master() to make cleanup paths simpler, and remove a duplicate put. Signed-off-by: Jingoo Han Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c index dbc5e99..b4426dd 100644 --- a/drivers/spi/spi-mpc512x-psc.c +++ b/drivers/spi/spi-mpc512x-psc.c @@ -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; }