Skip to content

Commit

Permalink
spi: octeon: 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>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Jingoo Han authored and Mark Brown committed Sep 26, 2013
1 parent 33e195a commit 22ad2d8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/spi/spi-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static int octeon_spi_probe(struct platform_device *pdev)
master->bits_per_word_mask = SPI_BPW_MASK(8);

master->dev.of_node = pdev->dev.of_node;
err = spi_register_master(master);
err = devm_spi_register_master(&pdev->dev, master);
if (err) {
dev_err(&pdev->dev, "register master failed: %d\n", err);
goto fail;
Expand All @@ -292,8 +292,6 @@ static int octeon_spi_remove(struct platform_device *pdev)
struct octeon_spi *p = spi_master_get_devdata(master);
u64 register_base = p->register_base;

spi_unregister_master(master);

/* Clear the CSENA* and put everything in a known state. */
cvmx_write_csr(register_base + OCTEON_SPI_CFG, 0);

Expand Down

0 comments on commit 22ad2d8

Please sign in to comment.