kernel: backport bcma patches queued for 3.20
[openwrt/svn-archive/archive.git] / target / linux / ipq806x / patches / 0134-spi-qup-Fix-order-of-spi_register_master.patch
1 From a7357be131e30fd1fb987b2cb343bc81db487f96 Mon Sep 17 00:00:00 2001
2 From: Andy Gross <agross@codeaurora.org>
3 Date: Thu, 12 Jun 2014 14:34:11 -0500
4 Subject: [PATCH 134/182] spi: qup: Fix order of spi_register_master
5
6 This patch moves the devm_spi_register_master below the initialization of the
7 runtime_pm. If done in the wrong order, the spi_register_master fails if any
8 probed slave devices issue SPI transactions.
9
10 Signed-off-by: Andy Gross <agross@codeaurora.org>
11 Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
12 ---
13 drivers/spi/spi-qup.c | 11 +++++++----
14 1 file changed, 7 insertions(+), 4 deletions(-)
15
16 --- a/drivers/spi/spi-qup.c
17 +++ b/drivers/spi/spi-qup.c
18 @@ -619,16 +619,19 @@ static int spi_qup_probe(struct platform
19 if (ret)
20 goto error;
21
22 - ret = devm_spi_register_master(dev, master);
23 - if (ret)
24 - goto error;
25 -
26 pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC);
27 pm_runtime_use_autosuspend(dev);
28 pm_runtime_set_active(dev);
29 pm_runtime_enable(dev);
30 +
31 + ret = devm_spi_register_master(dev, master);
32 + if (ret)
33 + goto disable_pm;
34 +
35 return 0;
36
37 +disable_pm:
38 + pm_runtime_disable(&pdev->dev);
39 error:
40 clk_disable_unprepare(cclk);
41 clk_disable_unprepare(iclk);