brcm2708: update to v3.18
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-3.18 / 0047-spi-bcm2708-Prepare-for-Common-Clock-Framework-migra.patch
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
7 As part of migrating to use the Common Clock Framework, replace clk_enable()
8 with clk_prepare_enable() and clk_disable() with clk_disable_unprepare().
9 This does not affect behaviour under the current clock implementation.
10
11 Also add a missing clk_disable_unprepare() in the probe error path.
12
13 Signed-off-by: Noralf Tronnes <notro@tronnes.org>
14 ---
15 drivers/spi/spi-bcm2708.c | 5 +++--
16 1 file changed, 3 insertions(+), 2 deletions(-)
17
18 diff --git a/drivers/spi/spi-bcm2708.c b/drivers/spi/spi-bcm2708.c
19 index b04a57d..349d21f 100644
20 --- a/drivers/spi/spi-bcm2708.c
21 +++ b/drivers/spi/spi-bcm2708.c
22 @@ -545,7 +545,7 @@ static int bcm2708_spi_probe(struct platform_device *pdev)
23 }
24
25 /* initialise the hardware */
26 - clk_enable(clk);
27 + clk_prepare_enable(clk);
28 bcm2708_wr(bs, SPI_CS, SPI_CS_REN | SPI_CS_CLEAR_RX | SPI_CS_CLEAR_TX);
29
30 err = spi_register_master(master);
31 @@ -561,6 +561,7 @@ static int bcm2708_spi_probe(struct platform_device *pdev)
32
33 out_free_irq:
34 free_irq(bs->irq, master);
35 + clk_disable_unprepare(bs->clk);
36 out_workqueue:
37 destroy_workqueue(bs->workq);
38 out_iounmap:
39 @@ -585,7 +586,7 @@ static int bcm2708_spi_remove(struct platform_device *pdev)
40
41 flush_work(&bs->work);
42
43 - clk_disable(bs->clk);
44 + clk_disable_unprepare(bs->clk);
45 clk_put(bs->clk);
46 free_irq(bs->irq, master);
47 iounmap(bs->base);
48 --
49 1.8.3.2
50