Skip to content

Commit

Permalink
spi/spi_tegra: use spi_unregister_master() instead of spi_master_put()
Browse files Browse the repository at this point in the history
spi_master_put() should only be used in error handling.
Once spi_register_master() returns success, we should call
spi_unregister_master() instead.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Axel Lin authored and Grant Likely committed May 20, 2011
1 parent 680c130 commit 8901e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi_tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev)
master = dev_get_drvdata(&pdev->dev);
tspi = spi_master_get_devdata(master);

spi_unregister_master(master);
tegra_dma_free_channel(tspi->rx_dma);

dma_free_coherent(&pdev->dev, sizeof(u32) * BB_LEN,
Expand All @@ -586,7 +587,6 @@ static int __devexit spi_tegra_remove(struct platform_device *pdev)
clk_put(tspi->clk);
iounmap(tspi->base);

spi_master_put(master);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(r->start, (r->end - r->start) + 1);

Expand Down

0 comments on commit 8901e1b

Please sign in to comment.