diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-09-24 00:47:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-26 06:42:53 -0400 |
commit | 1c43f2ae1ee3b04f7466e31a59b19b7fa5fe4fc2 (patch) | |
tree | 0b8caaa1f883cb49fe23b0d003bf2015a180ef94 /drivers/spi/spi-sh-hspi.c | |
parent | a807fcd090d6e778717d0954fc6a58a72ee16ba0 (diff) |
spi: sh-hspi: use devm_spi_register_master()
Use devm_spi_register_master() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-sh-hspi.c')
-rw-r--r-- | drivers/spi/spi-sh-hspi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/spi/spi-sh-hspi.c b/drivers/spi/spi-sh-hspi.c index 0b68cb592fa4..97e913d225f3 100644 --- a/drivers/spi/spi-sh-hspi.c +++ b/drivers/spi/spi-sh-hspi.c | |||
@@ -303,7 +303,7 @@ static int hspi_probe(struct platform_device *pdev) | |||
303 | master->mode_bits = SPI_CPOL | SPI_CPHA; | 303 | master->mode_bits = SPI_CPOL | SPI_CPHA; |
304 | master->auto_runtime_pm = true; | 304 | master->auto_runtime_pm = true; |
305 | master->transfer_one_message = hspi_transfer_one_message; | 305 | master->transfer_one_message = hspi_transfer_one_message; |
306 | ret = spi_register_master(master); | 306 | ret = devm_spi_register_master(&pdev->dev, master); |
307 | if (ret < 0) { | 307 | if (ret < 0) { |
308 | dev_err(&pdev->dev, "spi_register_master error.\n"); | 308 | dev_err(&pdev->dev, "spi_register_master error.\n"); |
309 | goto error1; | 309 | goto error1; |
@@ -328,7 +328,6 @@ static int hspi_remove(struct platform_device *pdev) | |||
328 | pm_runtime_disable(&pdev->dev); | 328 | pm_runtime_disable(&pdev->dev); |
329 | 329 | ||
330 | clk_put(hspi->clk); | 330 | clk_put(hspi->clk); |
331 | spi_unregister_master(hspi->master); | ||
332 | 331 | ||
333 | return 0; | 332 | return 0; |
334 | } | 333 | } |