From: Jingoo Han Date: Tue, 24 Sep 2013 04:47:59 +0000 (+0900) Subject: spi: sh-hspi: use devm_spi_register_master() X-Git-Tag: firefly_0821_release~176^2~5010^2~9^2^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1c43f2ae1ee3b04f7466e31a59b19b7fa5fe4fc2;p=firefly-linux-kernel-4.4.55.git spi: sh-hspi: use devm_spi_register_master() Use devm_spi_register_master() to make cleanup paths simpler. Signed-off-by: Jingoo Han Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown --- 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) 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; @@ -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; }