spi: rcar: Use devm_spi_register_master()

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>
This commit is contained in:
Jingoo Han 2013-12-04 14:13:50 +09:00 committed by Mark Brown
parent e80b89ee2a
commit 9e03d05eee
1 changed files with 1 additions and 2 deletions

View 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;