0047-spi-bcm2708-Prepare-for-Common-Clock-Framework-migra.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From d828fe6d765939e457e87d7f348adfe69cfd4175 Mon Sep 17 00:00:00 2001
  2. From: notro <notro@tronnes.org>
  3. Date: Sun, 6 Jul 2014 12:07:25 +0200
  4. Subject: [PATCH 047/114] spi-bcm2708: Prepare for Common Clock Framework
  5. migration
  6. As part of migrating to use the Common Clock Framework, replace clk_enable()
  7. with clk_prepare_enable() and clk_disable() with clk_disable_unprepare().
  8. This does not affect behaviour under the current clock implementation.
  9. Also add a missing clk_disable_unprepare() in the probe error path.
  10. Signed-off-by: Noralf Tronnes <notro@tronnes.org>
  11. ---
  12. drivers/spi/spi-bcm2708.c | 5 +++--
  13. 1 file changed, 3 insertions(+), 2 deletions(-)
  14. --- a/drivers/spi/spi-bcm2708.c
  15. +++ b/drivers/spi/spi-bcm2708.c
  16. @@ -545,7 +545,7 @@ static int bcm2708_spi_probe(struct plat
  17. }
  18. /* initialise the hardware */
  19. - clk_enable(clk);
  20. + clk_prepare_enable(clk);
  21. bcm2708_wr(bs, SPI_CS, SPI_CS_REN | SPI_CS_CLEAR_RX | SPI_CS_CLEAR_TX);
  22. err = spi_register_master(master);
  23. @@ -561,6 +561,7 @@ static int bcm2708_spi_probe(struct plat
  24. out_free_irq:
  25. free_irq(bs->irq, master);
  26. + clk_disable_unprepare(bs->clk);
  27. out_workqueue:
  28. destroy_workqueue(bs->workq);
  29. out_iounmap:
  30. @@ -585,7 +586,7 @@ static int bcm2708_spi_remove(struct pla
  31. flush_work(&bs->work);
  32. - clk_disable(bs->clk);
  33. + clk_disable_unprepare(bs->clk);
  34. clk_put(bs->clk);
  35. free_irq(bs->irq, master);
  36. iounmap(bs->base);