spi/s3c64xx: Use managed registration
Also improve the error reporting on failure and remove a duplicate put. This provides a small code saving. Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
parent
fbce71cae7
commit
91800f0e90
1 changed files with 3 additions and 7 deletions
|
@ -1428,9 +1428,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
|
||||||
S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN,
|
S3C64XX_SPI_INT_TX_OVERRUN_EN | S3C64XX_SPI_INT_TX_UNDERRUN_EN,
|
||||||
sdd->regs + S3C64XX_SPI_INT_EN);
|
sdd->regs + S3C64XX_SPI_INT_EN);
|
||||||
|
|
||||||
if (spi_register_master(master)) {
|
ret = devm_spi_register_master(&pdev->dev, master);
|
||||||
dev_err(&pdev->dev, "cannot register SPI master\n");
|
if (ret != 0) {
|
||||||
ret = -EBUSY;
|
dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret);
|
||||||
goto err3;
|
goto err3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1461,16 +1461,12 @@ static int s3c64xx_spi_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
spi_unregister_master(master);
|
|
||||||
|
|
||||||
writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
|
writel(0, sdd->regs + S3C64XX_SPI_INT_EN);
|
||||||
|
|
||||||
clk_disable_unprepare(sdd->src_clk);
|
clk_disable_unprepare(sdd->src_clk);
|
||||||
|
|
||||||
clk_disable_unprepare(sdd->clk);
|
clk_disable_unprepare(sdd->clk);
|
||||||
|
|
||||||
spi_master_put(master);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue