Skip to content

Commit

Permalink
spi: sh-hspi: 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.

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>
  • Loading branch information
Jingoo Han authored and Mark Brown committed Sep 26, 2013
1 parent a807fcd commit 1c43f2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/spi/spi-sh-hspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static int hspi_probe(struct platform_device *pdev)
master->mode_bits = SPI_CPOL | SPI_CPHA;
master->auto_runtime_pm = true;
master->transfer_one_message = hspi_transfer_one_message;
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 error1;
Expand All @@ -328,7 +328,6 @@ static int hspi_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);

clk_put(hspi->clk);
spi_unregister_master(hspi->master);

return 0;
}
Expand Down

0 comments on commit 1c43f2a

Please sign in to comment.