Skip to content

Commit

Permalink
spi: mpc512x: use devm_spi_register_master()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Mark Brown committed Sep 26, 2013
1 parent 434eaf3 commit eaa2429
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/spi/spi-mpc512x-psc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down

0 comments on commit eaa2429

Please sign in to comment.